.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_nested_pie_chart.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_auto_examples_plot_nested_pie_chart.py: Nested pie chart ================ An example of a nested pie chart. .. GENERATED FROM PYTHON SOURCE LINES 6-42 .. image-sg:: /auto_examples/images/sphx_glr_plot_nested_pie_chart_001.svg :alt: plot nested pie chart :srcset: /auto_examples/images/sphx_glr_plot_nested_pie_chart_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import niceplots plt.style.use(niceplots.get_style("james-dark")) colors = niceplots.get_colors() data = { "Pie": { "Lime": 5, "Apple": 8, "Cow": 3, }, "Not pie": { "Taco": 5, "Soup": 4, }, "Pizza": { "Cheese": 14, "White": 5, "Veggie": 12, }, } fig, ax = plt.subplots(figsize=(8, 8)) pieObjects = niceplots.plot_nested_pie(data, colors=list(colors.values()), ax=ax) # Customize one of the wedges... pieObjects["Pizza"]["Cheese"]["wedge"].set_radius(1.1) pieObjects["Pizza"]["Cheese"]["wedge"].set_width(0.4) # ...and its text pieObjects["Pizza"]["Cheese"]["text"].set_weight("bold") pieObjects["Pizza"]["Cheese"]["text"].set_x(-0.82) niceplots.save_figs(fig, "nested_pie_chart", ["png", "svg"]) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.357 seconds) .. _sphx_glr_download_auto_examples_plot_nested_pie_chart.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_nested_pie_chart.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_nested_pie_chart.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_nested_pie_chart.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_