import matplotlib.pylab as pb
#matplotlib模块下pylab可以绘制相应的散点图,折线图,直线图,子图
#而subplot是绘制简单的子图,他是根据你提供相应的数据所显示数据的区间
pb.subplot(2,2,2)
x=[1,3,5,7,9]
y=[2,4,6,8,10]
pb.plot(x,y)
pb.subplot(2,1,2)
x1=[1,5,7,4,3]
y1=[2,8,9,6,7]
pb.plot(x1,y1)
pb.subplot(2,2,1)
x2=[8,6,4,2,3]
y2=[5,4,3,2,1]
pb.plot(x2,y2)
pb.show()
原文地址:https://www.cnblogs.com/chunqing/p/9189177.html
时间: 2024-10-13 18:18:03