how to set axis range 28xlim 2c ylim 29 in matplotlib

Solutions on MaxInterview for how to set axis range 28xlim 2c ylim 29 in matplotlib by the best coders in the world

showing results for - "how to set axis range 28xlim 2c ylim 29 in matplotlib"
Aiden
06 Sep 2020
1fig, ax = plt.subplots(figsize=(12, 6))
2
3x = np.arange(0, 10, 0.1)
4y = np.sin(x)
5z = np.cos(x)
6
7ax.plot(y, color='blue', label='Sine wave')
8ax.plot(z, color='black', label='Cosine wave')
9
10plt.xlim([25, 50])
11plt.show()
12