import matplotlib.pyplot as plt
import numpy as np
import cProfile

x = np.logspace(0,2,5000)
y = np.random.normal(size=x.size)+10

for command in ['plot','semilogx','semilogy','loglog']:
    plt.clf()
    cProfile.run('plt.%s(x,y); plt.savefig("%s.pdf")'%(command,command))
