.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/introductory/07.polygon.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_gallery_introductory_07.polygon.py: ======= Polygon ======= Polygons in ternary plots can be put using ``ax.fill``. .. GENERATED FROM PYTHON SOURCE LINES 8-30 .. image-sg:: /gallery/introductory/images/sphx_glr_07.polygon_001.svg :alt: 07.polygon :srcset: /gallery/introductory/images/sphx_glr_07.polygon_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import mpltern # noqa: F401 ax = plt.subplot(111, projection='ternary') t = [0.2, 0.4, 0.2] l = [0.0, 0.2, 0.4] r = [0.8, 0.4, 0.4] ax.fill(t, l, r, alpha=0.2) t = [0.4, 0.6, 0.6, 0.4] l = [0.2, 0.2, 0.4, 0.4] r = [0.4, 0.2, 0.0, 0.2] ax.fill(t, l, r, alpha=0.2) t = [0.2, 0.4, 0.4, 0.0, 0.0] l = [0.4, 0.4, 0.6, 1.0, 0.6] r = [0.4, 0.2, 0.0, 0.0, 0.4] ax.fill(t, l, r, alpha=0.2) plt.show() .. _sphx_glr_download_gallery_introductory_07.polygon.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 07.polygon.ipynb <07.polygon.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 07.polygon.py <07.polygon.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_