from matplotlib import pyplot as plt
import numpy as np

"""
Explanation: Simple Plotting Example

First we import the modules matplotlib for plotting and numpy for numerical array manipulation:
End of explanation
"""


xs = np.linspace(-2, 2, num=100)
print(xs)

"""
Explanation: Next we set the variable xs to be an array of 100 equally spaced points in the interval [-1,1]:
End of explanation
"""


ys = xs*xs
print(ys)

"""
Explanation: Now we set the array ys to be the elementwise square of xs:
End of explanation
"""


plt.plot(xs, ys)
plt.xlabel('x')
plt.ylabel('y')
plt.title('plot of y = x**2')
plt.show()

"""
Explanation: Now we plot the result using matplotlib:
End of explanation
"""


