import numpy as np
import matplotlib.pyplot as plt
import math
from matplotlib.animation import FuncAnimation
# x, y = np.mgrid[0: 10: 10j, 0: 10 : 10j] #返回多维结构
# z = x
fig = plt.figure()
ax = plt.subplot(projection='polar')
xdata, ydata = [], []
ln, = plt.plot([], [], 'r.-')
def init():
ax.set_ylim(0, 180)
return ln,
def update(frame):
xdata.append(2*np.pi * frame)
ydata.append(frame)
ln.set_data(xdata, ydata)
# print(len(xdata))
print(2*np.pi * frame)
return ln,
ani = FuncAnimation(fig, update, frames=np.arange(30, 150, 0.084),
init_func = init, blit = True,repeat=False,interval=200)
#plt.get_current_fig_manager().window.showMaximized()
plt.show()
python3.6 极坐标画动画点
最新推荐文章于 2024-03-07 13:44:02 发布