You are reading an old version of the documentation (v1.5.0). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: log_demo.py

Next topic

pylab_examples example code: logo.py

This Page

pylab_examples example code: log_test.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/log_test.png
import matplotlib.pyplot as plt
import numpy as np

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

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

plt.show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)