#! /usr/bin/env python # 2008.10.01 Mark Neeser # # A python routine demonstrating log plots. Notice how python takes care of the correct scaling, # plot labels, and offsets. Nice.... import numpy as np from pylab import * # importing plotting modules subplots_adjust(hspace=0.4) t = np.arange(0.01, 50.0, 0.01) # some fake data # log y axis (base 10) subplot(311) semilogy(t, np.exp(-t/5.0)) ylabel('semilogy') grid(True) title('And there was much rejoicing!') # log x axis (base 10) subplot(312) semilogx(t, np.sin(2*np.pi*t)) ylabel('semilogx') grid(True) # both log x and y axes (base 4 on x-axis; base 10 on y-axis) subplot(313) loglog(t, 20*np.exp(-t/10.0), basex=4) grid(True) ylabel('loglog base 4 on x') show()