

.. _sphx_glr_gallery_userdemo_annotate_simple_coord02.py:


=======================
Annotate Simple Coord02
=======================





.. image:: /gallery/userdemo/images/sphx_glr_annotate_simple_coord02_001.png
    :align: center





.. code-block:: python


    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=(0.5, 1.), xycoords=an1,
                      xytext=(0.5, 1.1), textcoords=(an1, "axes fraction"),
                      va="bottom", ha="center",
                      bbox=dict(boxstyle="round", fc="w"),
                      arrowprops=dict(arrowstyle="->"))

    fig.subplots_adjust(top=0.83)
    plt.show()

**Total running time of the script:** ( 0 minutes  0.052 seconds)



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

     :download:`Download Python source code: annotate_simple_coord02.py <annotate_simple_coord02.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: annotate_simple_coord02.ipynb <annotate_simple_coord02.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
