.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "sphinx_gallery_output/plot_01_EulerDiagram.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_sphinx_gallery_output_plot_01_EulerDiagram.py: Euler diagrams ============== Euler diagrams are area-proportional set diagrams, i.e. each area is proportional to the size of the corresponding subset. The :py:class:`EulerDiagram` class supports initialisation from - a dictionary mapping subsets to their sizes, and - directly from a list of sets. In the latter case, the subset sizes will be computed internally. .. GENERATED FROM PYTHON SOURCE LINES 15-38 .. image-sg:: /sphinx_gallery_output/images/sphx_glr_plot_01_EulerDiagram_001.png :alt: plot 01 EulerDiagram :srcset: /sphinx_gallery_output/images/sphx_glr_plot_01_EulerDiagram_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from matplotlib_set_diagrams import EulerDiagram fig, (ax1, ax2) = plt.subplots(1, 2) EulerDiagram( { (1, 0) : 3, # {"a", "b", "c"} (0, 1) : 1, # {"e"} (1, 1) : 1, # {"d"} }, ax=ax1) EulerDiagram.from_sets( [ {"a", "b", "c", "d"}, {"d", "e"}, ], ax=ax2) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.092 seconds) .. _sphx_glr_download_sphinx_gallery_output_plot_01_EulerDiagram.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_EulerDiagram.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_EulerDiagram.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_EulerDiagram.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_