Skip to content

Instantly share code, notes, and snippets.

Last active December 15, 2015 22:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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.plot(x, sin(exp(x)), label="sin(e^x)")
pl.plot(x[250:], sin(np.log(x[250:])), label="sin(ln(x)")
pl.ylim (-1.05, 1.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment