matplotlib中在for中画出多张图
Posted chen狗蛋儿
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了matplotlib中在for中画出多张图相关的知识,希望对你有一定的参考价值。
import matplotlib.pyplot as plt import numpy as np fig, axes = plt.subplots(2, 2) def showim(): for i in range(2): for j in range(2): axes[i,j].plot(np.random.randint(10,size=10)) # 为每个子图添加标题 axes[i,j].set_title("picture "+str(i)+" "+str(j)) fig.tight_layout() # 为每个子图去掉坐标轴刻度 axes[i,j].set_xticks([]) axes[i,j].set_yticks([]) showim() plt.show()
以上是关于matplotlib中在for中画出多张图的主要内容,如果未能解决你的问题,请参考以下文章
怎样用matlab中画出模糊控制器2个输入,3个输出的隶属函数图