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

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

.. _sphx_glr_gallery_misc_coords_report.py:


=============
Coords Report
=============

Override the default reporting of coords as the mouse moves over the Axes
in an interactive backend.

.. GENERATED FROM PYTHON SOURCE LINES 9-29



.. image-sg:: /gallery/misc/images/sphx_glr_coords_report_001.png
   :alt: coords report
   :srcset: /gallery/misc/images/sphx_glr_coords_report_001.png, /gallery/misc/images/sphx_glr_coords_report_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. code-block:: Python


    import matplotlib.pyplot as plt
    import numpy as np


    def millions(x):
        return '$%1.1fM' % (x * 1e-6)


    # Fixing random state for reproducibility
    np.random.seed(19680801)

    x = np.random.rand(20)
    y = 1e7 * np.random.rand(20)

    fig, ax = plt.subplots()
    ax.fmt_ydata = millions
    plt.plot(x, y, 'o')

    plt.show()


.. _sphx_glr_download_gallery_misc_coords_report.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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