[問題] 國徽中間的圓為何無法填滿白色
小弟寫了一個繪製國徽的程式如下, 執行以後總是不能把中間的圓填滿白色,
甚是苦惱, 請問各位大大, 有沒有辦法?
=======================================================
import math
import matplotlib.pyplot as plt
fig , ax = plt.subplots()
n = 12
hop = 5
theta = 6.2832 / n
for x in range(n):
y = (x+hop) % n
cx = math.cos(x * theta) * 240 + 360
cy = math.cos(y * theta) * 240 + 360
sx = math.sin(x * theta) * 240 + 270
sy = math.sin(y * theta) * 240 + 270
plt.plot([cx, cy], [sx, sy], color="b")
cir1 = plt.Circle(xy = (360, 270), radius=120, color='b', linewidth=10,
fill=True)
cir2 = plt.Circle(xy = (360, 270), radius=100, color='w', linewidth=10,
fill=True)
ax.add_patch(cir1)
ax.add_patch(cir2)
plt.axis('scaled')
plt.axis('equal')
plt.show()
--
<)".."(>
( (..) )
im a pig
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.200.38.86 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1649065227.A.A6F.html
推
04/05 02:39,
2年前
, 1F
04/05 02:39, 1F
推
04/05 09:43,
2年前
, 2F
04/05 09:43, 2F
→
04/06 22:23,
2年前
, 3F
04/06 22:23, 3F