.. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` 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`. .. 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 ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: log_test.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_