lotlib.pyplot常用属性
时间: 2023-12-30 12:20:55 浏览: 40
matplotlib.pyplot是一个Python数据可视化库,常用于绘制各种类型的图表。以下是matplotlib.pyplot常用的属性:
1. plt.plot(x, y):绘制折线图。
2. plt.scatter(x, y):绘制散点图。
3. plt.bar(x, y):绘制柱状图。
4. plt.hist(x, bins):绘制直方图。
5. plt.pie(x):绘制饼图。
6. plt.xlabel():设置x轴标签。
7. plt.ylabel():设置y轴标签。
8. plt.title():设置图表标题。
9. plt.legend():添加图例。
10. plt.grid():添加网格线。
11. plt.xlim():设置x轴范围。
12. plt.ylim():设置y轴范围。
13. plt.xticks():设置x轴刻度。
14. plt.yticks():设置y轴刻度。
15. plt.subplots():创建子图。
16. plt.savefig():保存图表为图片。
17. plt.show():显示图表。
相关推荐
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)