mirror of
https://github.com/Estom/notes.git
synced 2026-11-28 15:15:27 +08:00
matplotlib & pandas
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# 简单轴方向01
|
||||
|
||||

|
||||
|
||||
```python
|
||||
import matplotlib.pyplot as plt
|
||||
import mpl_toolkits.axisartist as axisartist
|
||||
|
||||
fig = plt.figure(figsize=(4, 2.5))
|
||||
ax1 = fig.add_subplot(axisartist.Subplot(fig, "111"))
|
||||
fig.subplots_adjust(right=0.8)
|
||||
|
||||
ax1.axis["left"].major_ticklabels.set_axis_direction("top")
|
||||
ax1.axis["left"].label.set_text("Label")
|
||||
|
||||
ax1.axis["right"].label.set_visible(True)
|
||||
ax1.axis["right"].label.set_text("Label")
|
||||
ax1.axis["right"].label.set_axis_direction("left")
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||
## 下载这个示例
|
||||
|
||||
- [下载python源码: simple_axis_direction01.py](https://matplotlib.org/_downloads/simple_axis_direction01.py)
|
||||
- [下载Jupyter notebook: simple_axis_direction01.ipynb](https://matplotlib.org/_downloads/simple_axis_direction01.ipynb)
|
||||
Reference in New Issue
Block a user