How to get the y-axis range of a plot in Matplotlib in Python

Getting the y-axis range of a Matplotlib plot returns the lower and upper view limits of the y-axis.

Solution for How to get the y-axis range of a plot in Matplotlib in Python : You can use matplotlib.axes.Axes.get_ylim() to get the y-axis range Call matplotlib.pyplot.gca() to get the current axes of the graph. Use matplotlib.axes.Axes.get_ylim() to get the minimum and maximum limits on the y-axis.


how-to-get-the-y-axis-range-of-a-plot-in-matplotlib-in-python