mirror of
https://github.com/Estom/notes.git
synced 2026-11-27 13:51:42 +08:00
matplotlib & pandas
This commit is contained in:
37
Python/matplotlab/gallery/pyplots/fig_x.md
Normal file
37
Python/matplotlab/gallery/pyplots/fig_x.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# X图
|
||||
|
||||
添加线条到图形(没有轴)。
|
||||
|
||||
```python
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.lines as lines
|
||||
|
||||
|
||||
fig = plt.figure()
|
||||
|
||||
l1 = lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig)
|
||||
|
||||
l2 = lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig)
|
||||
|
||||
fig.lines.extend([l1, l2])
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||

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