.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/introductory/11.triangular_grid.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_11.triangular_grid.py: =============== Triangular grid =============== A triangular grid can be plotted by giving the grid points to ``ax.triplot``. .. GENERATED FROM PYTHON SOURCE LINES 8-24 .. image-sg:: /gallery/introductory/images/sphx_glr_11.triangular_grid_001.svg :alt: 11.triangular grid :srcset: /gallery/introductory/images/sphx_glr_11.triangular_grid_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from mpltern.datasets import get_triangular_grid t, l, r = get_triangular_grid() fig = plt.figure(figsize=(10.8, 4.8)) fig.subplots_adjust(wspace=0.3) ax = fig.add_subplot(121, projection='ternary') ax.triplot(t, l, r) ax = fig.add_subplot(122, projection='ternary') ax.triplot(t, l, r, marker='o') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.386 seconds) .. _sphx_glr_download_gallery_introductory_11.triangular_grid.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 11.triangular_grid.ipynb <11.triangular_grid.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 11.triangular_grid.py <11.triangular_grid.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_