

.. _sphx_glr_gallery_pyplots_annotation_polar.py:


================
Annotation Polar
================





.. image:: /gallery/pyplots/images/sphx_glr_annotation_polar_001.png
    :align: center





.. code-block:: python

    import numpy as np
    import matplotlib.pyplot as plt

    fig = plt.figure()
    ax = fig.add_subplot(111, polar=True)
    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()

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



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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