Skip to content

Sin Cosin Example Def'ed

Jesse Bacon edited this page Mar 23, 2015 · 3 revisions
#Crispy
def grid():
    import numpy as np
    x=np.random.randn(10)
    matplotlib.rcParams['axes.color_cycle']=['r','k','c']
    matplotlib.pyplot.plot(x, np.sin(x), '-r', label='sin')
    matplotlib.pyplot.plot(x, np.cos(x), '--g', label='cosin')
    matplotlib.pyplot.xticks([-10,0,10])
    matplotlib.pyplot.yticks([-1,0,1])
    matplotlib.pyplot.ylim(-2,2)
    matplotlib.pyplot.legend()
    matplotlib.pyplot.grid()