Matplotlib.pyplot.yticks() in Python Last Updated : 12 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.yticks() Function The annotate() function in pyplot module of matplotlib library is used to get and set the current tick locations and labels of the y-axis. Syntax: matplotlib.pyplot.yticks(ticks=None, labels=None, **kwargs) Parameters: This method accept the following parameters that are described below: ticks: This parameter is the list of xtick locations. and an optional parameter. If an empty list is passed as an argument then it will removes all xticks labels: This parameter contains labels to place at the given ticks locations. And it is an optional parameter. **kwargs: This parameter is Text properties that is used to control the appearance of the labels. Returns: This returns the following: locs :This returns the list of ytick locations. labels :This returns the list of ylabel Text objects. The resultant is (locs, labels) Below examples illustrate the matplotlib.pyplot.yticks() function in matplotlib.pyplot: Example #1: Python3 1== # Implementation of matplotlib.pyplot.yticks() # function import numpy as np import matplotlib.pyplot as plt # values of x and y axes valx = [30, 35, 50, 5, 10, 40, 45, 15, 20, 25] valy = [1, 4, 3, 2, 7, 6, 9, 8, 10, 5] plt.plot(valx, valy) plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.xticks(np.arange(0, 60, 5)) plt.yticks(np.arange(0, 15, 1)) plt.show() Output: Example #2: Python3 1== #Implementation of matplotlib.pyplot.yticks() # function import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes def get_demo_image(): from matplotlib.cbook import get_sample_data import numpy as np f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 return z, (3, 19, 4, 13) fig, ax = plt.subplots(figsize=[5, 4]) Z, extent = get_demo_image() ax.set(aspect=1, xlim=(0, 65), ylim=(0, 50)) axins = zoomed_inset_axes(ax, zoom=2, loc='upper right') im = axins.imshow(Z, extent=extent, interpolation="nearest", origin="upper") plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.yticks(visible=False) plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.yticks() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.pyplot.xticks() in Python matplotlib.pyplot.xticks() function is used to get or set the x-axis ticks in a plot. This function allows you to modify the labels and positions of the ticks along the x-axis, providing greater flexibility and control over your plots. Let's see an example to better understand this. Example: Set Cus 3 min read Python | Matplotlib.pyplot ticks Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. It was introduced by John Hunter in the year 2003.One of the greatest benefits of visual 3 min read Matplotlib.pyplot.ylim() 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.ylim() Function The ylim() function in pyplot module of matplotlib library is used to g 2 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.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.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.tick_params() in Python Matplotlib is a visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. matplotlib.pyplot.tick_params() matplotlib.pyplot.tick_params() is used to change the appearance 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.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 Like