> ## Documentation Index
> Fetch the complete documentation index at: https://base.bangwu.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Matplotlib

> Matplotlib 是 Python 生态中最主流的 2D 数据绘图与可视化库，本文涵盖 pyplot 模块的类 MATLAB 绑图接口使用方法，演示折线图、直方图、条形图、散点图与误差图等常见图表类型的创建流程、样式参数调整技巧以及面向对象高级绑图接口与官方文档示例资源索引。

# Matplotlib介绍

## 什么是Matplotlib

Matplotlib是一个Python 2D绘图库，它以多种硬拷贝格式和跨平台的交互式环境生成出版物质量的图形。 Matplotlib可用于Python脚本，Python和[IPythonopen in new window](http://ipython.org/) Shell、[Jupyteropen in new window](http://jupyter.org/)笔记本，Web应用程序服务器和四个图形用户界面工具包。

Matplotlib 尝试使容易的事情变得更容易，使困难的事情变得可能。 您只需几行代码就可以生成图表、直方图、功率谱、条形图、误差图、散点图等。 更多的示例，请参见[基础绘图例子](https://www.matplotlib.org.cn/tutorials/introductory/sample_plots.html)和[示例陈列馆](https://www.matplotlib.org.cn/gallery/index.html)。

![img](https://bangwu.oss-cn-shanghai.aliyuncs.com/img/202305130748189.png)

为了简单绘图，该 `pyplot` 模块提供了类似于MATLAB的界面，尤其是与IPython结合使用时。 对于高级用户，您可以通过面向对象的界面或MATLAB用户熟悉的一组功能来完全控制线型，字体属性，轴属性等。

## Matplotlib官方文档示例

试图学习如何做某种图例？请查看[示例陈列馆](https://www.matplotlib.org.cn/gallery)或[绘图命令列表](https://matplotlib.org/api/pyplot_summary.html)，大家不要畏惧看官方文档，虽然官方文档有些没有注释，还是英文的，但是官方文档一般是最全的库使用方法手册，而且目前页面翻译基本能够满足我们的阅读要求，实在遇到理解不了的函数，就去社区搜索，或者问大佬。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.