even my man
unknown
python
3 years ago
244 B
4
Indexable
Never
import numpy as np import matplotlib.pyplot as plt def f(x): return 2*np.sin(x) + 5/2 x= np.linspace(1, 20, 1000) y = f(x) y[y >= 4] = 4 y[y <= 1 ] = 1 plt.figure() plt.plot(x, y, linewidth=3) plt.show()