Skip to content

Instantly share code, notes, and snippets.

@Goddard
Created December 27, 2016 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goddard/fdd0b455877e8905eb13e6d469f269ae to your computer and use it in GitHub Desktop.
Save Goddard/fdd0b455877e8905eb13e6d469f269ae to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
def graph(formula, x_range):
x = np.array(x_range)
y = formula(x)
plt.plot(x, y)
plt.show()
def my_formula(x):
return (x % 6)**2 % 7 - np.sin(x)
graph(my_formula, range(1, 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment