How to do it…

Run the following code in a single Jupyter cell:

xvalues = np.linspace(-np.pi, np.pi)
yvalues1 = np.sin(xvalues)
yvalues2 = np.cos(xvalues)
plt.plot(xvalues, yvalues1, lw=2, color='red',
label='sin(x)')
plt.plot(xvalues, yvalues2, lw=2, color='blue',
label='cos(x)')
plt.title('Trigonometric Functions')
plt.xlabel('x')
plt.ylabel('sin(x), cos(x)')
plt.axhline(0, lw=0.5, color='black')
plt.axvline(0, lw=0.5, color='black')
plt.legend()
None

This code will insert the plot shown in the following screenshot into the Jupyter Notebook:

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

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