【发布时间】:2022-01-15 11:50:10
【问题描述】:
如何绘制这些圆形结构: https://blogs.scientificamerican.com/guest-blog/making-mathematical-art/
在pyplot中?我试过这个:
x = np.arange(1,11)
def f(x):
return np.cos((10*np.pi*x)/14000)*(1-(1/2)*(np.square(np.cos((16*np.pi*x)/16000))))
def z(x):
return np.sin((10*np.pi*x)/14000)*(1-(1/2)*(np.square(np.cos((16*np.pi*x)/16000))))
def w(x):
return 1/200 + 1/10*np.power((np.sin(52*np.pi*x)/14000),4)
plt.ylim(-10, 10)
plt.title("Matplotlib demo")
plt.xlabel("x axis caption")
plt.ylabel("y axis caption")
x1=np.linspace(0,14000)
results=f(x1)
results2 = z(x1)
results3 = w(x1)
plt.plot(results)
plt.plot(results2)
plt.plot(results3)
plt.show()
【问题讨论】:
标签: python numpy matplotlib math plot