How to do it…

Run the following commands in a Jupyter cell:

plt.figure(figsize=(6,6))
xvalues = np.linspace(-2, 2, 100)
plt.subplot(2, 2, 1)
yvalues = xvalues
plt.plot(xvalues, yvalues, color='blue')
plt.xlabel('$x$')
plt.ylabel('$x$')
plt.subplot(2, 2, 2)
yvalues = xvalues ** 2
plt.plot(xvalues, yvalues, color='green')
plt.xlabel('$x$')
plt.ylabel('$x^2$')
plt.subplot(2, 2, 3)
yvalues = xvalues ** 3
plt.plot(xvalues, yvalues, color='red')
plt.xlabel('$x$')
plt.ylabel('$x^3$')
plt.subplot(2, 2, 4)
yvalues = xvalues ** 4
plt.plot(xvalues, yvalues, color='black')
plt.xlabel('$x$')
plt.ylabel('$x^3$')
plt.suptitle('Polynomial Functions')
plt.tight_layout()
plt.subplots_adjust(top=0.90)
None

Running this code will produce results like those in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset