In [1]:
import numpy
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
x = numpy.array([2**x for x in range(0, 31)])
y1 = numpy.linspace(0, 30000, 31) * (1 + numpy.random.random(31)) * 2
y2 = numpy.linspace(0, 35000, 31) * (1 + numpy.random.random(31)) * 3
In [3]:
plt.semilogx(x, y1, basex=2)
plt.semilogx(x, y2, basex=2)
plt.title("Foobar Performance")
plt.ylabel("Foodicity [Baz/second]")
plt.xlabel("Size")
plt.savefig('example_plain.png', bbox_inches='tight')
In [7]:
plt.semilogx(x, y1, basex=2)
plt.semilogx(x, y2, basex=2)
plt.title("Foobar Performance")
plt.ylabel("Foodicity [Baz/second]")
plt.xlabel("Size")
import sys, os
sys.path.insert(0, os.path.abspath(".."))
import prettyplot
prettyplot.config_plot(plt.gca())
prettyplot.natural_log2_xaxis(plt.gca(), [2**i for i in [0, 5, 10, 15, 20, 25, 30]])
plt.savefig('example_prettyplot.png', bbox_inches='tight')