Matplotlib.pyplot.ylim() in Python Last Updated : 13 Apr, 2020 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.ylim() Function The ylim() function in pyplot module of matplotlib library is used to get or set the y-limits of the current axes. Syntax: matplotlib.pyplot.ylim(*args, **kwargs) Parameters: This method accept the following parameters that are described below: bottom: This parameter is used to set the ylim to bottom. top: This parameter is used to set the ylim to top. **kwargs: This parameter is Text properties that is used to control the appearance of the labels. Returns: This returns the following: bottom, top :This returns the tuple of the new y-axis limits. Below examples illustrate the matplotlib.pyplot.ylim() function in matplotlib.pyplot: Example #1: Python3 1== # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np ax = plt.subplot(111) t = np.arange(0.0, 5.0, 0.01) s = np.cos(2 * np.pi * t) line, = plt.plot(t, s, lw = 2) plt.annotate('local max', xy =(2, 1), xytext =(3, 1.5), arrowprops = dict(facecolor ='black', shrink = 0.05), ) plt.ylim(-2, 2) plt.title(" matplotlib.pyplot.ylim() Example") plt.show() Output: Example #2: Python3 1== # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np np.random.seed(9680801) mu, sigma = 50, 13 x = mu + sigma * np.random.randn(10000) # the histogram of the data n, bins, patches = plt.hist(x, 50, density = True, facecolor ='g', alpha = 0.75) plt.xlabel('No of Users in K') plt.title('Histogram of IQ') plt.text(50, .035, r'$\mu = 50,\ \ \sigma = 13$') plt.xlim(-10, 110) plt.ylim(0, 0.04) plt.grid(True) plt.title(" matplotlib.pyplot.ylim() Example") plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.ylim() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.pyplot.xlim() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.sci() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.yticks() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. Matplotlib.pyplot.yticks() Function The annotate() function in pyplot module of matplotlib library is use 2 min read Matplotlib.pyplot.yscale() in Python Matplotlib Is a library in Python and it is a numerical - mathematical extension for the NumPy library. Pyplot Is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.yscale() in Python The matplotlib.pyplot.yscale() function in pyplot module of ma 2 min read Matplotlib.pyplot.ylabel() in Python Matplotlib is a very powerful plotting library useful for those working with Python and NumPy. And for making statistical interference, it becomes very necessary to visualize our data and Matplotlib is the tool that can be very helpful for this purpose. matplotlib.pyplot.ylabel() This function sets 2 min read Matplotlib.pyplot.ylabels() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.ylabel() Function The ylabel() function in pyplot module of matplotlib library is used 2 min read Matplotlib.pyplot.sca() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 1 min read Matplotlib.pyplot.twiny() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. Sample Code Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 8 2 min read Matplotlib.pyplot.twinx() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. Sample Code Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 8 2 min read Matplotlib.pyplot.show() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. Sample Code - Python3 1== # sample code import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 2 min read Like