小弟写了一个绘制国徽的程式如下, 执行以后总是不能把中间的圆填满白色,
甚是苦恼, 请问各位大大, 有没有办法?
=======================================================
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()