In [33]: import matplotlib.pyplot as plt
In [37]: %matplotlib
Using matplotlib backend: Qt5Agg
In [35]: data
Out[35]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
使用plt.show()
显示所有图片。
图片与子图
# 产生空白图片,显示出来
In [40]: fig = plt.figure()
In [51]: ax1 = fig.add_subplot(2,2,1)
In [52]: ax2 = fig.add_subplot(2,2,2)
In [53]: ax3 = fig.add_subplot(2,2,3)
# 画图显示 如下图
In [59]: plt.plot([1.5, 3.5, -2, 1.6])
Out[59]: [<matplotlib.lines.Line2D at 0x20fb5210e48>]
# 'k--’是用于绘制黑色分段线的style选项
In [62]