import matplotlib.pyplot as plt
import numpy as np

'''
plt.title("plot")
plt.plot([1,4,9,16])
plt.show()


plt.title("x data add")
plt.plot([10,20,30,40],[1,4,9,16])
plt.show()

plt.title("'rs--' style plot")
plt.plot([10,20,30,40], [1,4,9,16], 'rs--')
plt.show()


plt.plot([10,20,30,40],[1,4,9,16],c='b',lw=5,ls="--",marker="o",ms=15,mec="g",mew=5,mfc="r")
plt.title("style add")
plt.show()

plt.plot([10,20,30,40],[1,4,9,16],c='b',lw=5,ls="--",marker="o",ms=15,mec="g",mew=5,mfc="r")
plt.xlim(0,50)
plt.ylim(-10,30)
plt.show()


X = np.linspace(-np.pi,np.pi,256)
C = np.cos(X)
plt.plot(X,C)
plt.xticks([-np.pi,-np.pi/2,0,np.pi/2,np.pi])
plt.yticks([-1,0,+1])
plt.show()

X = np.linspace(-np.pi,np.pi,256)
C = np.cos(X)
plt.plot(X,C)
plt.xticks([-np.pi,-np.pi/2,0,np.pi/2,np.pi],[r'$-\pi$',r'$-\pi/2$',r'$0$',r'$+\pi/2$',r'$+\pi$'])
plt.yticks([-1,0,1],['Low','Zero','High'])
plt.show()

t = np.arange(0.,5.,0.2)
plt.plot(t,t,'r--',t,0.5*t**2,'bs:',t,0.2*t**3,'g^-')
plt.show()

plt.plot([1,4,9,16],c='b',lw=5,ls='--',marker='o',ms=15,mec='g',mew=5,mfc="r")

'''
X = np.linspace(-np.pi,np.pi,256)
C, S = np.cos(X), np.sin(X)
plt.plot(X,C,ls='--',label='cosine')
plt.plot(X,S,ls=":",label='sine')
plt.legend(loc=2)
plt.show()

X = np.linspace(-np.pi, np.pi, 256)
C, S = np.cos(X), np.sin(X)
plt.plot(X,C,label='cosine')
plt.xlabel('time')
plt.ylabel('amplitude')
plt.title('Cosine Plot')
plt.legend(loc=2)
plt.show()