当前位置:主页 > 软件编程 > Python代码 >

python绘制多个子图的实例

时间:2021-06-30 09:23:09 | 栏目:Python代码 | 点击:

绘制八个子图

import matplotlib.pyplot as plt

fig = plt.figure()

shape=['.','o','v','>','<','8','s','*']
for j in range(8):
  x=[i for i in range(6)]
  y=[i**2 for i in range(6)]
  ax = fig.add_subplot(241+j)
  ax.scatter(x,y,c='r',marker=shape[j])
  ax.set_title('第'+str(j))
plt.show()

您可能感兴趣的文章:

相关文章