{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Ticklabel direction\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n\nimport mpl_toolkits.axisartist.axislines as axislines\n\n\ndef setup_axes(fig, pos):\n    ax = fig.add_subplot(pos, axes_class=axislines.Axes)\n    ax.set_yticks([0.2, 0.8])\n    ax.set_xticks([0.2, 0.8])\n    return ax\n\n\nfig = plt.figure(figsize=(6, 3))\nfig.subplots_adjust(bottom=0.2)\n\nax = setup_axes(fig, 131)\nfor axis in ax.axis.values():\n    axis.major_ticks.set_tick_out(True)\n# or you can simply do \"ax.axis[:].major_ticks.set_tick_out(True)\"\n\nax = setup_axes(fig, 132)\nax.axis[\"left\"].set_axis_direction(\"right\")\nax.axis[\"bottom\"].set_axis_direction(\"top\")\nax.axis[\"right\"].set_axis_direction(\"left\")\nax.axis[\"top\"].set_axis_direction(\"bottom\")\n\nax = setup_axes(fig, 133)\nax.axis[\"left\"].set_axis_direction(\"right\")\nax.axis[:].major_ticks.set_tick_out(True)\n\nax.axis[\"left\"].label.set_text(\"Long Label Left\")\nax.axis[\"bottom\"].label.set_text(\"Label Bottom\")\nax.axis[\"right\"].label.set_text(\"Long Label Right\")\nax.axis[\"right\"].label.set_visible(True)\nax.axis[\"left\"].label.set_pad(0)\nax.axis[\"bottom\"].label.set_pad(10)\n\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.14.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}