.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/triangle/01.triangle_rotation.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_triangle_01.triangle_rotation.py: ================= Triangle rotation ================= The triangle for a ternary plot can be rotated by `rotation`. Axis labels, tick labels, and tick markers are also automatically aligned. .. GENERATED FROM PYTHON SOURCE LINES 9-35 .. image-sg:: /gallery/triangle/images/sphx_glr_01.triangle_rotation_001.svg :alt: rotation=0, rotation=90, rotation=180, rotation=270 :srcset: /gallery/triangle/images/sphx_glr_01.triangle_rotation_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from mpltern.datasets import get_spiral t, l, r = get_spiral() fig = plt.figure(figsize=(10.8, 8.8)) fig.subplots_adjust( left=0.1, right=0.9, hspace=0.75, ) rotations = range(0, 360, 90) for i, rotation in enumerate(rotations): ax = fig.add_subplot(2, 2, i + 1, projection='ternary', rotation=rotation) ax.plot(t, l, r) ax.set_tlabel('Top') ax.set_llabel('Left') ax.set_rlabel('Right') ax.set_title(f"rotation={rotation}") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.064 seconds) .. _sphx_glr_download_gallery_triangle_01.triangle_rotation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01.triangle_rotation.ipynb <01.triangle_rotation.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01.triangle_rotation.py <01.triangle_rotation.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_