python

超轻量级php框架startmvc

python绘制多个子图的实例

更新时间:2020-07-12 05:18:01 作者:startmvc
绘制八个子图importmatplotlib.pyplotaspltfig=plt.figure()shape=['.','o','v','>','<','8','s','*']forjinrange(8

绘制八个子图


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()

以上这篇python绘制多个子图的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

python 绘制 子图