#
#  Shows basic matplotlib 2D plot
#  of x vs sin(x). X and Y values 
#  are created using numpy arrays     
#

import numpy as np
import matplotlib.pyplot as plt
# Program plots x vs sin(x) in [0,2*PI]
xvalues = np.linspace(0, 2*np.pi, 1000)
yvalues = np.sin(xvalues)
plt.plot(xvalues, yvalues, 'b-')
#plt.title('Plot of x vs sin(x)')
#plt.xlabel('x')
#plt.ylabel('sin(x)')
plt.show()
#plt.savefig('sin_plot.png')

# Challenge exercise:
#   Plot cosine x on same plot (use red color: 'r-')
#   Add legend in top right hand corner
#   with plt.legend()
