// log y axis
plt.subplot(221)
plt.semilogy(t, np.exp(-t/5.0))
plt.title("semilogy")
plt.grid(True)
// log x axis
plt.subplot(222)
After Change
t = np.arange(0.01, 20.0, 0.01)
// Create figure
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
// Note hspace is the amount of height reserved for white space between subplots
// expressed as a fraction of the average axis height
fig.subplots_adjust(hspace=0.5)
// log y axis
ax1.semilogy(t, np.exp(-t/5.0))
ax1.set(title="semilogy")
ax1.grid()
// log x axis
ax2.semilogx(t, np.sin(2*np.pi*t))
ax2.set(title="semilogx")
ax2.grid()
// log x and y axis
ax3.loglog(t, 20*np.exp(-t/10.0), basex=2)
ax3.set(title="loglog base 2 on x")