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

.. only:: html

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

        Click :ref:`here <sphx_glr_download_gallery_scales_log_test.py>`
        to download the full example code

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

.. _sphx_glr_gallery_scales_log_test.py:


========
Log Axis
========

This is an example of assigning a log-scale for the x-axis using
`~.axes.Axes.semilogx`.

.. GENERATED FROM PYTHON SOURCE LINES 9-22



.. image:: /gallery/scales/images/sphx_glr_log_test_001.png
    :alt: log test
    :class: sphx-glr-single-img





.. code-block:: default


    import matplotlib.pyplot as plt
    import numpy as np

    fig, ax = plt.subplots()

    dt = 0.01
    t = np.arange(dt, 20.0, dt)

    ax.semilogx(t, np.exp(-t / 5.0))
    ax.grid()

    plt.show()


.. _sphx_glr_download_gallery_scales_log_test.py:


.. only :: html

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



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

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



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

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


.. only:: html

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

    Keywords: matplotlib code example, codex, python plot, pyplot
    `Gallery generated by Sphinx-Gallery
    <https://sphinx-gallery.readthedocs.io>`_
