mirror of
https://github.com/Estom/notes.git
synced 2026-04-23 18:11:47 +08:00
matplotlib & pandas
This commit is contained in:
25
Python/matplotlab/gallery/userdemo/anchored_box03.md
Normal file
25
Python/matplotlab/gallery/userdemo/anchored_box03.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 锚定Box03
|
||||
|
||||

|
||||
|
||||
```python
|
||||
from matplotlib.patches import Ellipse
|
||||
import matplotlib.pyplot as plt
|
||||
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredAuxTransformBox
|
||||
|
||||
|
||||
fig, ax = plt.subplots(figsize=(3, 3))
|
||||
|
||||
box = AnchoredAuxTransformBox(ax.transData, loc='upper left')
|
||||
el = Ellipse((0, 0), width=0.1, height=0.4, angle=30) # in data coordinates!
|
||||
box.drawing_area.add_artist(el)
|
||||
|
||||
ax.add_artist(box)
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||
## 下载这个示例
|
||||
|
||||
- [下载python源码: anchored_box03.py](https://matplotlib.org/_downloads/anchored_box03.py)
|
||||
- [下载Jupyter notebook: anchored_box03.ipynb](https://matplotlib.org/_downloads/anchored_box03.ipynb)
|
||||
Reference in New Issue
Block a user