
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/text_labels_and_annotations/annotation_polar.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. meta::
        :keywords: codex

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_text_labels_and_annotations_annotation_polar.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_text_labels_and_annotations_annotation_polar.py:


====================
Annotate polar plots
====================

This example shows how to create an annotation on a polar graph.

For a complete overview of the annotation capabilities, also see the
:ref:`annotations`.

.. redirect-from:: /gallery/pyplots/annotation_polar

.. GENERATED FROM PYTHON SOURCE LINES 13-35

.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

    fig = plt.figure()
    ax = fig.add_subplot(projection='polar')
    r = np.arange(0, 1, 0.001)
    theta = 2 * 2*np.pi * r
    line, = ax.plot(theta, r, color='#ee8d18', lw=3)

    ind = 800
    thisr, thistheta = r[ind], theta[ind]
    ax.plot([thistheta], [thisr], 'o')
    ax.annotate('a polar annotation',
                xy=(thistheta, thisr),  # theta, radius
                xytext=(0.05, 0.05),    # fraction, fraction
                textcoords='figure fraction',
                arrowprops=dict(facecolor='black', shrink=0.05),
                horizontalalignment='left',
                verticalalignment='bottom',
                )
    plt.show()




.. image-sg:: /gallery/text_labels_and_annotations/images/sphx_glr_annotation_polar_001.png
   :alt: annotation polar
   :srcset: /gallery/text_labels_and_annotations/images/sphx_glr_annotation_polar_001.png, /gallery/text_labels_and_annotations/images/sphx_glr_annotation_polar_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 36-43

.. admonition:: References

   The use of the following functions, methods, classes and modules is shown
   in this example:

   - `matplotlib.projections.polar`
   - `matplotlib.axes.Axes.annotate` / `matplotlib.pyplot.annotate`


.. _sphx_glr_download_gallery_text_labels_and_annotations_annotation_polar.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

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

    .. container:: sphx-glr-download sphx-glr-download-python

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

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: annotation_polar.zip <annotation_polar.zip>`


.. only:: html

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

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