import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation fig, ax = plt.subplots()
x = np.arange(0, 2*np.pi, 0.01)
print(len(x))
print(x)
line, = ax.plot(x, np.sin(x)) def animate(i):
line.set_ydata(np.sin(x+i/10))
return line, def init():
line.set_ydata(np.sin(x))
return line, # func 表示animation的动画, frames表示100个时间点, init_func 表示初始点,
# inyterval 表示每隔多少时间点刷新 一次, blit是否是全部更新, 如果为FLASE则更新需要更新的点
ani = animation.FuncAnimation(fig=fig, func=animate, frames=100, init_func=init, interval=20, blit=False) plt.savefig('./image_dir/animation.png')
plt.tight_layout()
plt.show()

最新文章

  1. linq分页组合查询
  2. 基础SQL语句/语法
  3. H5项目常见问题及注意事项
  4. FusionCharts简单教程(四)-----基本数字格式
  5. MVC的路径查找顺序
  6. CI框架源码分析
  7. 2.HTML5 标准改变,准备工作
  8. 为Elasticsearch添加中文分词,对比分词器效果
  9. mongodb数据库设计原则
  10. hdu 5497 Inversion 树状数组 逆序对,单点修改
  11. Cortex-mo指令集
  12. 子进程 已安装 post-installation 脚本 返回错误状态 1,dpkg: 处理软件包 python-crypto (--configure)时出错: 该软件包正处于非常不稳定的状态;
  13. h5 动画页面
  14. LeetCode(55)- Palindrome Linked List
  15. jquery touch 移动端上下滑动加载
  16. 通过安全网闸访问MongoDB
  17. 复制粘贴插件(不包含 Flash)——clipboard.js
  18. U盘安装centos7 关键步骤
  19. 4-23 模块 hashlib ,configparser,loging,collections
  20. java解决手机上传竖拍照片旋转90\180\270度问题

热门文章

  1. Spring 为啥默认把bean设计成单例的?
  2. mybatis中<![CDATA[]]>和转义字符
  3. 纯前端实现词云展示+附微博热搜词云Demo代码
  4. CodeBlocks调试器缺少(gdb.exe)文件
  5. NLP 开源形近字算法补完计划(完结篇)
  6. 没有人比我更会使用集合!对, 是dart中的集合
  7. 【Linux】(1)安装
  8. maven私服-仓库图
  9. 压力测试工具——apchebench(简称ab)
  10. Excel-返回列表或数据库中的分类汇总(汇总可以实现要还是不要统计隐藏行功能) subtotal()