网站建设买什么书,宁德网站建设51yunsou,做yahoo代拍网站公司,代做毕网站作者#xff1a;禹棋赢本文推荐一个仓库Plot-Pictures-Tutorial-for-Papergithub.com该仓库会总结论文中常见图形的画法#xff0c;本节介绍折线图#xff1a;一、折线图绘制折线图我们通常使用plot函数画曲线#xff08;折线#xff09;。每一个plot函数对应一条曲线禹棋赢本文推荐一个仓库Plot-Pictures-Tutorial-for-Papergithub.com该仓库会总结论文中常见图形的画法本节介绍折线图一、折线图绘制折线图我们通常使用plot函数画曲线折线。每一个plot函数对应一条曲线画多条线的时候调用多个plot函数即可。plot()函数前两个参数为x、y。xX轴数据列表或数组yY轴数据列表或数组。后面还有很多的修饰曲线的参数常用的有color控制曲线颜色linestyle缩写ls控制曲线的风格marker控制数据点的风格等其对应的常用字符在文章最后的附录。示例fig, axes plt.subplots(1, 1, figsize(8, 4))
# 折线图
axes.plot(x, y, linestyle-, color#DE6B58, markerx, linewidth1.5)
axes.plot(x, y2, linestyle-, color#E1A084, markerx, linewidth1.5)
# 设置最小刻度间隔
axes.yaxis.set_minor_locator(MultipleLocator(2.5))
axes.xaxis.set_minor_locator(MultipleLocator(0.5))
# 画网格线
axes.grid(whichminor, clightgrey)
# 设置x、y轴标签
axes.set_ylabel(Generation Consistency)
axes.set_xlabel(KB Row Number)
# 设置y轴的刻度
axes.set_yticks([70, 75, 80, 85, 90, 95])
# 对每个数据点加标注
for x_, y_ in zip(x, y):axes.text(x_, y_, y_, haleft, vabottom)
for x_, y_ in zip(x, y2):axes.text(x_, y_, y_, haleft, vabottom)
# 展示图片
plt.show()效果如下更多内容可以见github仓库https://github.com/yizhen20133868/Plot-Pictures-Tutorial-for-Papergithub.com