In [5]:
#%matplotlib inline
%matplotlib notebook
import matplotlib
from IPython.display import set_matplotlib_formats

matplotlib.rcParams['figure.dpi'] = 150
set_matplotlib_formats('retina')
In [6]:
import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0.005, 100, 1)

fig, ax = plt.subplots()
plt.ylim(ymin=-0.5, ymax=10)
plt.xlim(xmin=0, xmax=100)
plt.ylabel("Running Time (s)")
plt.xlabel("Input Size (GB)")
plt.xticks(np.arange(min(x), max(x)+1, 10.0))

ax.plot(x, np.log(x/10) + 2, label='prog1 ($\logN$)', color='b')
ax.plot(x, (x/10)**3, label='prog2 (cubic)', color='m')


legend = plt.legend(loc='upper center', fontsize='small')

plt.savefig('big-o.pdf')
plt.show()