0
点赞
收藏
分享

微信扫一扫

170622 Save plot to image file instead of displaying it using Matplotlib

勇敢乌龟 2023-03-03 阅读 16


​​Issue description​​

Answer as following

170622 Save plot to image file instead of displaying it using Matplotlib_html


Code

import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cm

for i in range(10):
data = np.random.randint(1,99,(10,10))
plt.ioff() # prevent showing the picture
plt.matshow(data,cmap=cm.RdYlGn) # plot the picture
plt.savefig('rms_map//'+str(i)+'.png')

170622 Save plot to image file instead of displaying it using Matplotlib_git_02

Color Example
​​​https://matplotlib.org/examples/color/colormaps_reference.html​​​
Gitbook Resource
​​​https://www.gitbook.com/@wizardforcel​​


举报

相关推荐

0 条评论