
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/ticks/tick_label_right.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. meta::
        :keywords: codex

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_ticks_tick_label_right.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_ticks_tick_label_right.py:


============================================
Set default y-axis tick labels on the right
============================================

We can use :rc:`ytick.labelright`, :rc:`ytick.right`, :rc:`ytick.labelleft`,
and :rc:`ytick.left` to control where on the axes ticks and their labels
appear. These properties can also be set in ``.matplotlib/matplotlibrc``.

.. GENERATED FROM PYTHON SOURCE LINES 11-28



.. image-sg:: /gallery/ticks/images/sphx_glr_tick_label_right_001.png
   :alt: tick label right
   :srcset: /gallery/ticks/images/sphx_glr_tick_label_right_001.png, /gallery/ticks/images/sphx_glr_tick_label_right_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

    plt.rcParams['ytick.right'] = plt.rcParams['ytick.labelright'] = True
    plt.rcParams['ytick.left'] = plt.rcParams['ytick.labelleft'] = False

    x = np.arange(10)

    fig, (ax0, ax1) = plt.subplots(2, 1, sharex=True, figsize=(6, 6))

    ax0.plot(x)
    ax0.yaxis.tick_left()

    # use default parameter in rcParams, not calling tick_right()
    ax1.plot(x)

    plt.show()


.. _sphx_glr_download_gallery_ticks_tick_label_right.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: tick_label_right.ipynb <tick_label_right.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: tick_label_right.py <tick_label_right.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: tick_label_right.zip <tick_label_right.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
