.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/userdemo/annotate_simple_coord01.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_userdemo_annotate_simple_coord01.py: ======================= Annotate Simple Coord01 ======================= .. GENERATED FROM PYTHON SOURCE LINES 7-20 .. image-sg:: /gallery/userdemo/images/sphx_glr_annotate_simple_coord01_001.png :alt: annotate simple coord01 :srcset: /gallery/userdemo/images/sphx_glr_annotate_simple_coord01_001.png, /gallery/userdemo/images/sphx_glr_annotate_simple_coord01_001_2_0x.png 2.0x :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize=(3, 2)) an1 = ax.annotate("Test 1", xy=(0.5, 0.5), xycoords="data", va="center", ha="center", bbox=dict(boxstyle="round", fc="w")) an2 = ax.annotate("Test 2", xy=(1, 0.5), xycoords=an1, xytext=(30, 0), textcoords="offset points", va="center", ha="left", bbox=dict(boxstyle="round", fc="w"), arrowprops=dict(arrowstyle="->")) plt.show() .. _sphx_glr_download_gallery_userdemo_annotate_simple_coord01.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: annotate_simple_coord01.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: annotate_simple_coord01.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_