even my man
unknown
python
4 years ago
244 B
11
Indexable
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()
Editor is loading...