.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\python_packages\matplotlib\demo_polar.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_python_packages_matplotlib_demo_polar.py: Polar axis ============= Demo of a line plot on a polar axis. .. GENERATED FROM PYTHON SOURCE LINES 6-24 .. image-sg:: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_polar_001.png :alt: A line plot on a polar axis :srcset: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_polar_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt r = np.arange(0, 2, 0.01) theta = 2 * np.pi * r plt.figure() ax = plt.subplot(111, projection="polar") ax.plot(theta, r) ax.set_rmax(2) ax.set_rticks([0.5, 1, 1.5, 2]) # less radial ticks ax.set_rlabel_position(-22.5) # get radial labels away from plotted line ax.grid(True) ax.set_title("A line plot on a polar axis", va="bottom") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.054 seconds) .. _sphx_glr_download_11_demos_python_packages_matplotlib_demo_polar.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_polar.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_polar.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_polar.zip `