In [1]:
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.style as style
%matplotlib inline
style.use('../pub.mplstyle')
In [2]:
# data
xvals = np.arange(1, 8, 0.5)
# plot
fig, ax = plt.subplots()
for i in range(1, 8):
yvals = np.multiply(i, xvals**2.0)
ax.plot(xvals, yvals, label='$y = ' + str(i) + ' x^2$')
# plot labels
ax.set_xlabel('x-label (arb.)')
ax.set_ylabel('y-label (arb.)')
# legend
plt.legend(loc=0, frameon=False)
# output
fileout = os.path.join("./", "example")
plt.savefig(fileout)
plt.show()
In [ ]: