Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
a bunch of sin and cos
import numpy as np
import pylab as pl
from numpy import sin, cos
x = np.linspace(-10, 10, 500)
pl.plot(x, sin(x), label="sin")
pl.plot(x, cos(x), label="cos")
pl.plot(x, sin(x) + cos(x), label="sin + cos")
pl.plot(x, pow(sin(x), 2), label = "sin^2")
# Bonus plot!
pl.figure()
pl.plot(x, sin(exp(x)), label="sin(e^x)")
pl.plot(x[250:], sin(np.log(x[250:])), label="sin(ln(x)")
pl.legend().draggable()
pl.ylim (-1.05, 1.05)
pl.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment