
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/axisartist/simple_axis_direction03.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_axisartist_simple_axis_direction03.py>`
        to download the full example code.

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

.. _sphx_glr_gallery_axisartist_simple_axis_direction03.py:


==========================================
Simple axis tick label and tick directions
==========================================

First subplot moves the tick labels to inside the spines.
Second subplot moves the ticks to inside the spines.
These effects can be obtained for a standard Axes by `~.Axes.tick_params`.

.. GENERATED FROM PYTHON SOURCE LINES 10-39



.. image-sg:: /gallery/axisartist/images/sphx_glr_simple_axis_direction03_001.png
   :alt: simple axis direction03
   :srcset: /gallery/axisartist/images/sphx_glr_simple_axis_direction03_001.png, /gallery/axisartist/images/sphx_glr_simple_axis_direction03_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. code-block:: Python


    import matplotlib.pyplot as plt

    import mpl_toolkits.axisartist as axisartist


    def setup_axes(fig, pos):
        ax = fig.add_subplot(pos, axes_class=axisartist.Axes)
        ax.set_yticks([0.2, 0.8])
        ax.set_xticks([0.2, 0.8])
        return ax


    fig = plt.figure(figsize=(5, 2))
    fig.subplots_adjust(wspace=0.4, bottom=0.3)

    ax1 = setup_axes(fig, 121)
    ax1.set_xlabel("ax1 X-label")
    ax1.set_ylabel("ax1 Y-label")

    ax1.axis[:].invert_ticklabel_direction()

    ax2 = setup_axes(fig, 122)
    ax2.set_xlabel("ax2 X-label")
    ax2.set_ylabel("ax2 Y-label")

    ax2.axis[:].major_ticks.set_tick_out(False)

    plt.show()


.. _sphx_glr_download_gallery_axisartist_simple_axis_direction03.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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