

.. _sphx_glr_gallery_ticks:

.. _ticks_examples:

Ticks
=====



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Setting the behavior of tick auto-placement.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_auto_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_auto_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Automatically setting tick positions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ticklabels are aligned relative to their associated tick. The alignment &#x27;center&#x27;, &#x27;left&#x27;, or &#x27;r...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_centered_ticklabels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_centered_ticklabels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Centering labels between ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Vertical colorbars have ticks, tick labels, and labels visible on the y axis, horizontal colorb...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_colorbar_tick_labelling_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_colorbar_tick_labelling_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colorbar Tick Labelling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The matplotlib.ticker module defines many preset tickers, but was primarily designed for extens...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_custom_ticker1_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_custom_ticker1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Ticker</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Finding good tick values and formatting the ticks for an axis that has date data is often a cha...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_concise_formatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_concise_formatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Formatting date ticks using ConciseDateFormatter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Date Demo Convert">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_demo_convert_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_demo_convert.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date Demo Convert</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The `iCalender RFC`_ specifies recurrence rules (rrules), that define date sequences. You can u...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_demo_rrule_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_demo_rrule.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Placing date ticks using recurrence rules</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the usage and effect of the various date locators and formatters.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_formatters_locators_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_formatters_locators.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date tick locators and formatters</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When plotting daily data, e.g., financial time series, one often wants to leave out days on whi...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_index_formatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_index_formatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom tick formatter for time series</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can handle .datetime objects and numpy.datetime64 objects using a unit converter tha...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_precision_and_epochs_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_precision_and_epochs.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date Precision and Epochs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a ~.ticker.FormatStrFormatter to prepend dollar signs on y-axis labels.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_dollar_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_dollar_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dollar ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Customize the background, labels and ticks of a simple plot.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_fig_axes_customize_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_fig_axes_customize_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fig Axes Customize Simple</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to use major and minor tickers.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_major_minor_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_major_minor_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Major and minor ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want another level of tick labels on an axis, perhaps to indicate a grouping of th...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_multilevel_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_multilevel_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multilevel (nested) ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="By default, tick labels are formatted using a .ScalarFormatter, which can be configured via ~.a...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_scalarformatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_scalarformatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The default tick formatter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Tick formatters define how the numeric value associated with a tick on an axis is formatted as ...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick-formatters_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick-formatters.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tick formatters</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Tick locators define the position of the ticks.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick-locators_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick-locators.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tick locators</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We can use ytick.labelright, ytick.right, ytick.labelleft, and ytick.left to control where on t...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_label_right_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_label_right.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Set default y-axis tick labels on the right</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using .Axes.set_xticks causes the tick labels to be set on the currently chosen ticks. However,...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_labels_from_values_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_labels_from_values.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Setting tick labels from a list of values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="~.axes.Axes.tick_params can be used to configure the ticks. top and labeltop control the visibi...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_xlabel_top_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_xlabel_top.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Move x-axis tick labels to the top</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of custom tick-labels with user-defined rotation.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_ticklabels_rotation_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_ticklabels_rotation.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rotating custom tick labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="One common cause for unexpected tick behavior is passing a list of strings instead of numbers o...">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_ticks_too_many_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_ticks_too_many.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fixing too many ticks</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/ticks/auto_ticks
   /gallery/ticks/centered_ticklabels
   /gallery/ticks/colorbar_tick_labelling_demo
   /gallery/ticks/custom_ticker1
   /gallery/ticks/date_concise_formatter
   /gallery/ticks/date_demo_convert
   /gallery/ticks/date_demo_rrule
   /gallery/ticks/date_formatters_locators
   /gallery/ticks/date_index_formatter
   /gallery/ticks/date_precision_and_epochs
   /gallery/ticks/dollar_ticks
   /gallery/ticks/fig_axes_customize_simple
   /gallery/ticks/major_minor_demo
   /gallery/ticks/multilevel_ticks
   /gallery/ticks/scalarformatter
   /gallery/ticks/tick-formatters
   /gallery/ticks/tick-locators
   /gallery/ticks/tick_label_right
   /gallery/ticks/tick_labels_from_values
   /gallery/ticks/tick_xlabel_top
   /gallery/ticks/ticklabels_rotation
   /gallery/ticks/ticks_too_many

