.. _sphx_glr_gallery_scales_log_test.py: ======== Log Axis ======== This is an example of assigning a log-scale for the x-axis using `semilogx`. .. image:: /gallery/scales/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() .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: https://static.mybinder.org/badge.svg :target: https://mybinder.org/v2/gh/choldgraf/matplotlib/gh-pages?filepath=_downloads/log_test.ipynb :width: 150 px .. container:: sphx-glr-download :download:`Download Python source code: log_test.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: log_test.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_