
import numpy as np import matplotlib.pyplot as plt import matplotlib #数据准备 #numpy.linspace(start,stop,num=50,endpoint=True,retstep=False,dtype=None) x=np.linspace(0,2* np.pi,10) y=np.sin(x) #画线 #lw=线宽 #label=本条线的图例名称 #marker #markeredgewIDth 或 mew line1=plt.plot(x,y,‘g‘,label=‘line_1‘,lw=2,marker=‘<‘,mew=3) plt.axis([min(x),max(x),min(y),max(y)])#坐标轴范围 plt.legend()#显示图例 plt.xlabel("X轴",FontpropertIEs=‘SimHei‘,Fontsize=8)#坐标轴标注 plt.ylabel("Y轴",Fontsize=8) plt.Title(‘折线图‘,Fontsize=12)#标题 plt.show()
详细教程:https://www.cnblogs.com/onemorepoint/p/7482644.html
总结以上是内存溢出为你收集整理的matplotlib系列——折线图全部内容,希望文章能够帮你解决matplotlib系列——折线图所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)