Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- plt.figure(figsize=(6, 6))
- x = np.linspace(-np.pi, np.pi)
- y = np.sin(x)
- z = np.cos(x)
- plt.plot(x, y, "o", color="orange", label="sin")
- plt.plot(x, z, "v", label="cos")
- plt.xlim(-np.pi, np.pi)
- plt.xticks([-np.pi/2, 0, np.pi/2], [r"$-\frac{\pi}{2}$", "$x^2$", r"$\frac{\pi}{2}$"])
- plt.ylim(-np.pi, np.pi)
- plt.scatter(1, 1, color="red")
- plt.scatter([1, 1.1, 1.2], [1.2, 1.1, 1], color="orange")
- plt.annotate("max of sin", xy=(x[np.argmax(y)], np.max(y)))
- plt.legend(loc="upper left")
- #plt.plot(x, y, linestyle="-")
- a = np.random.random_sample(10)
- b = np.random.random_sample(10)
- #plt.plot(a, b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement