Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aryamanarora/73ecc3423f7e359208ad79c32c527a71 to your computer and use it in GitHub Desktop.
Save aryamanarora/73ecc3423f7e359208ad79c32c527a71 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
def fun(x):
#This is where all the info on the function goes
if x < 28:
return 100000*x - 2721000
else:
return 79000
vfun = np.vectorize(fun)
x = np.linspace(27,29)
y = vfun(x)
plt.axis([27,29,-25000,90000])
plt.plot(x,y,'-')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment