Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #How to plot a function in python:
- xspace = np.linspace(0 , 2 , 1000)
- # = np.linspace(start , end , number of points)
- def f(x):
- return x**2 + 2*x + 1 #Type in your function here
- plt.plot(xspace, f(xspace), 'k--', label=r'Hello') #Use xspace on this line rather than x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement