.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/axis_and_tick/01.axis_label_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_axis_and_tick_01.axis_label_rotation.py: =================== Axis-label rotation =================== Axis-label rotation can be controlled via e.g. ``ax.taxis.set_label_rotation_mode``. - ``'axis'``: along the axis opposite to the corner - ``'horizontal'``: horizontal to the figure .. Note:: The ``'manual'`` option is also provided. In this mode, it becomes possible to specify the ``Text`` properties like ``horizontalalignment``, ``verticalalignment``, and ``rotation`` of axis labels directly, which are anymore never modified automatically by mpltern. .. GENERATED FROM PYTHON SOURCE LINES 18-46 .. image-sg:: /gallery/axis_and_tick/images/sphx_glr_01.axis_label_rotation_001.svg :alt: label_rotation_mode='axis', label_rotation_mode='horizontal' :srcset: /gallery/axis_and_tick/images/sphx_glr_01.axis_label_rotation_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from mpltern.datasets import get_spiral pad = 42 t, l, r = get_spiral() fig = plt.figure(figsize=(10.8, 4.8)) fig.subplots_adjust(wspace=0.3) modes = ['axis', 'horizontal'] for i, mode in enumerate(modes): ax = fig.add_subplot(1, 2, i + 1, projection='ternary') ax.plot(t, l, r) ax.set_tlabel('Top') ax.set_llabel('Left') ax.set_rlabel('Right') ax.taxis.set_label_rotation_mode(mode) ax.laxis.set_label_rotation_mode(mode) ax.raxis.set_label_rotation_mode(mode) ax.set_title("label_rotation_mode='{}'".format(mode), pad=pad) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.541 seconds) .. _sphx_glr_download_gallery_axis_and_tick_01.axis_label_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.axis_label_rotation.ipynb <01.axis_label_rotation.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01.axis_label_rotation.py <01.axis_label_rotation.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_