mirror of
https://github.com/Estom/notes.git
synced 2026-02-12 14:56:04 +08:00
matplotlib & pandas
This commit is contained in:
27
Python/matplotlab/gallery/pyplots/pyplot_formatstr.md
Normal file
27
Python/matplotlab/gallery/pyplots/pyplot_formatstr.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Pyplot 格式字符串(Formatstr)
|
||||
|
||||
使用格式字符串为绘图([plot](https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.plot.html#matplotlib.axes.Axes.plot))着色并设置其标记。
|
||||
|
||||
```python
|
||||
import matplotlib.pyplot as plt
|
||||
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
|
||||
plt.axis([0, 6, 0, 20])
|
||||
plt.show()
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 参考
|
||||
|
||||
此示例中显示了以下函数,方法,类和模块的使用:
|
||||
|
||||
```python
|
||||
import matplotlib
|
||||
matplotlib.pyplot.plot
|
||||
matplotlib.axes.Axes.plot
|
||||
```
|
||||
|
||||
## 下载这个示例
|
||||
|
||||
- [下载python源码: pyplot_formatstr.py](https://matplotlib.org/_downloads/pyplot_formatstr.py)
|
||||
- [下载Jupyter notebook: pyplot_formatstr.ipynb](https://matplotlib.org/_downloads/pyplot_formatstr.ipynb)
|
||||
Reference in New Issue
Block a user