9951 explained code solutions for 126 technologies


python-matplotlibHow to set Y axis range


import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.ylim(-2, 5)
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.plot(

plot specified data

.ylim

set min and max values for Y axis

.show()

render chart in a separate window