Example taken from http://docs.scipy.org/doc/numpy/reference/generated/numpy.sin.html
In [15]:
import numpy as np
import matplotlib.pylab as plt
Enable plotting in the current Notebook.
In [19]:
%matplotlib inline
Sin parameters
In [20]:
k = 2 # Number of undulations
Plot the sine function!
In [30]:
x = np.linspace(0, 2*k*np.pi, 201)
plt.plot(x, np.sin(x), linewidth = 2)
plt.title('Sin(x) plotting example')
plt.xlabel('Angle [rad]')
plt.ylabel('sin(x)')
plt.axis([0,2 *k*np.pi, -1.1, 1.1])
plt.grid()
plt.show()
In [17]: