当前位置:网站首页>数据输出-绘制动图
数据输出-绘制动图
2022-07-28 00:23:00 【坠金】
from matplotlib import animation
# 将迭代过程中保存下来的中间过程的图片制作成gif, 可以看到GMM模型的变化过程
imgs = []
fig = plt.figure()
#模型迭代时产生了一共有model.iterations张图片,存放在C:/Users/mage/Desktop/powSys/EM_GMM2/img中,制作动画就是根据这些静态图
for i in range(model.iterations):
path = "C:/Users/mage/Desktop/powSys/EM_GMM2/img/iteration" + str(i) + ".png"
img = plt.imread(path)
img = plt.imshow(img, animated=True)
imgs.append([img])
"""plt.figure()函数的作用是新建一张图像,这个图像是一个类似于相框一样的东西,上面可以放图片。这里"""
ani = animation.ArtistAnimation(fig,
imgs,
interval=500,
blit=True,
repeat_delay=1000)
ani.save("C:/Users/mage/Desktop/powSys/EM_GMM2/iterationAnime.gif", writer="pillow")边栏推荐
- [interview: concurrent article 28:volatile] orderliness
- Software testing interview question: why should we carry out testing in a team?
- Gbase 8C transaction ID and snapshot (IV)
- Gbase 8C backup control function (IV)
- Use of recursion: 1. Convert the tiled array to a tree 2. Convert the tree to a tiled array
- N32L43x Flash读\写\擦除操作总结
- 什么是方法,什么是方法论:了解自我精进提升的底层逻辑
- 云原生爱好者周刊:Prometheus 架构演进之路
- leetcode: 515. 在每个树行中找最大值
- IIC读写EEFPROM
猜你喜欢

HyperMesh circular array - plug in

Process data and change the name of data

白质脑功能网络图论分析:抑郁症分类和预测的神经标记

BGP联邦实验

The storage cost is reduced by 80%. How does the cost management of youzan data middle office do?

暴雪《暗黑破坏神 4》PS5 / PS4 测试版添加到 PlayStation 数据库

【面试:并发篇28:volatile】有序性

Enterprise operation and maintenance practice - using aliyun container image service to pull and build images of overseas GCR and quay warehouses

企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建

集合/容器
随机推荐
Gbase 8C snapshot synchronization function
Real time synchronization and conversion of massive data based on Flink CDC
BGP federal experiment
js 哪些情况不能用 JSON.parse 、JSON.stringify深拷贝及一个更好的深拷贝方法
What is method and methodology: understand the underlying logic of self-improvement
基于 Flink CDC 实现海量数据的实时同步和转换
Small bulk quantitative stock trading record | data is the source in the quantitative system, which teaches you to build a universal data source framework
Lambda表达式和Stream流
Data warehouse construction - DWS floor
Gbase 8C transaction ID and snapshot (VI)
处理数据 给数据换名字
Gbase 8C configuration setting function
GBase 8c 配置设置函数
Graph theory analysis of white matter brain function network: neural markers for classification and prediction of depression
Gbase 8C database object size function (I)
Favorite songs
[interview: concurrent article 28:volatile] orderliness
软件测试面试题:测试计划工作的目的是什么?测试计划工作的内容都包括什么?其中哪些是最重要的?
Game 302 of leetcode
物企大变局时代,SRM供应商采购系统助力企业打造物业采购数字化标杆