多窗口实时画图
#!/usr/bin/env python
import matplotlib.pyplot as plt
ax = []
ay = []
bx = []
by = []
plt.ion()
fig = plt.figure(num=1)
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212)
for i in range(100):
ax.append(i)
ay.append(i**2)
bx.append(i**2)
by.append(i)
# plt.clf()
ax1.plot(ax,ay,'r')
ax2.plot(bx,by,'g')
plt.pause(0.1)
# plt.ioff()
最后
以上就是爱撒娇自行车最近收集整理的关于Python中matplotlib画动态图的全部内容,更多相关Python中matplotlib画动态图内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复