.. _sphx_glr_gallery_userdemo_anchored_box03.py: ============== Anchored Box03 ============== .. image:: /gallery/userdemo/images/sphx_glr_anchored_box03_001.png :align: center .. code-block:: 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=2) 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() .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: https://static.mybinder.org/badge.svg :target: https://mybinder.org/v2/gh/choldgraf/matplotlib/gh-pages?filepath=_downloads/anchored_box03.ipynb :width: 150 px .. container:: sphx-glr-download :download:`Download Python source code: anchored_box03.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: anchored_box03.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_