Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- def f1(x):
- return np.exp(np.sin(x)) + 1
- def f2(x):
- return np.cos(x)**2 - 5
- def f3(x):
- return 1 / (np.cos(x**2) + 5)
- x = np.linspace(0, 100, 1000)
- y1 = f1(x)
- y2 = f2(x)
- y3 = f3(x)
- plt.xlabel("x")
- plt.ylabel("y")
- plt.plot(x, y1, label='f(x) = e^sin(x)')
- plt.plot(x, y2, label='f(x) = cos(x)^2 - 5')
- plt.plot(x, y3, label='f(x) = 1 / (cos(x^2) + 5)')
- plt.grid()
- plt.legend()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement