teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

Update

2021/11/24 05:25

投稿

melian
melian

スコア21265

answer CHANGED
@@ -11,14 +11,14 @@
11
11
  star_points = []
12
12
  for i in range(10):
13
13
  if i%2==0:
14
- star_points.append([r*math.cos(math.pi/2 + i*math.pi*2/5 + x), r*math.sin(math.pi/2 + i*math.pi*2/5) + y])
14
+ star_points.append([r*math.cos(math.pi/2 + i*math.pi*2/5) + x, r*math.sin(math.pi/2 + i*math.pi*2/5) + y])
15
15
 
16
16
  a = Polygon(xy=star_points, closed=True, color=c)
17
17
  return a
18
18
 
19
19
  fig = plt.figure(figsize=(4, 4))
20
20
  ax = fig.add_subplot(111)
21
- ax.set_xlim([-2, 2])
21
+ ax.set_xlim([-1, 3])
22
22
  ax.set_ylim([-1, 3])
23
23
 
24
24
  xs=[0, 2]
@@ -33,5 +33,4 @@
33
33
 
34
34
  plt.show()
35
35
  ```
36
-
37
- ![star](fdffa74f278ee1d954a05822d0c52e74.png)
36
+ ![star](f99fe21e1332b9ae50d46dd4eaea521f.png)