文章目录
- 1、准备工作
- 安装包
- 导入包
- 2、一些简单操作
- 加载需要画的数据
- 设置标题
- 区域覆盖
- 设置y轴标签
- 设置x轴标签
- 设置x轴y轴范围
- 将最终结果显示出来
- 散点图
- 设置x,y轴范围
- 3、参考文献
1、准备工作
安装包
导入包
2、一些简单操作
加载需要画的数据
x:横坐标
y:纵座标
lifestyle(ls):曲线风格
lw:曲线宽度
label:展示在图片右下角的曲线名称
设置标题
区域覆盖
为制定区域填充
这里就表示在横坐标为x下,y1与y2之间进行填充,有一边解释的比较详细的文章这里
设置y轴标签
设置x轴标签
设置x轴y轴范围
将最终结果显示出来
散点图
设置x,y轴范围
3、参考文献
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplots.html https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplot.html
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplots.html#matplotlib.pyplot.subplots https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.barh.html?highlight=barh#matplotlib.pyplot.barh
https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.yticks.html?highlight=yticks#matplotlib.pyplot.yticks
https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.xticks.html?highlight=xticks#matplotlib.pyplot.xticks
https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.barh.html?highlight=barh#matplotlib.pyplot.bar
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html