

.. _sphx_glr_gallery_pylab_examples_log_test.py:


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

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




.. image:: /gallery/pylab_examples/images/sphx_glr_log_test_001.png
    :align: center





.. code-block:: python


    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()

**Total running time of the script:** ( 0 minutes  0.024 seconds)



.. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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

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

    `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
