plt.ylim([a,b])
ylim() Function. The ylim() function in pyplot module of matplotlib library is used to get or set the y-limits of the current axes