.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/pretty_plots/plot_polar_ext.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end <sphx_glr_download_intro_matplotlib_auto_examples_pretty_plots_plot_polar_ext.py>` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_polar_ext.py: Plotting in polar, decorated ============================= An example showing how to plot in polar coordinate, and some decorations. .. GENERATED FROM PYTHON SOURCE LINES 8-54 .. image-sg:: /intro/matplotlib/auto_examples/pretty_plots/images/sphx_glr_plot_polar_ext_001.png :alt: plot polar ext :srcset: /intro/matplotlib/auto_examples/pretty_plots/images/sphx_glr_plot_polar_ext_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib import matplotlib.pyplot as plt plt.subplot(1, 1, 1, polar=True) N = 20 theta = np.arange(0.0, 2 * np.pi, 2 * np.pi / N) rng = np.random.default_rng() radii = 10 * rng.random(N) width = np.pi / 4 * rng.random(N) bars = plt.bar(theta, radii, width=width, bottom=0.0) jet = matplotlib.colormaps["jet"] for r, bar in zip(radii, bars, strict=True): bar.set_facecolor(jet(r / 10.0)) bar.set_alpha(0.5) plt.gca().set_xticklabels([]) plt.gca().set_yticklabels([]) plt.text( -0.2, 1.02, " Polar Axis \n", horizontalalignment="left", verticalalignment="top", size="xx-large", bbox={"facecolor": "white", "alpha": 1.0}, transform=plt.gca().transAxes, ) plt.text( -0.2, 1.01, "\n\n Plot anything using polar axis ", horizontalalignment="left", verticalalignment="top", size="large", transform=plt.gca().transAxes, ) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.079 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_pretty_plots_plot_polar_ext.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_polar_ext.ipynb <plot_polar_ext.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_polar_ext.py <plot_polar_ext.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_polar_ext.zip <plot_polar_ext.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_