How to Adjust Number of Ticks in Seaborn Plots?
In this article, we will discuss how to adjust the number of ticks in Seaborn Plots. Ticks are the values that are used to show some specific points on the X-Y coordinate, It can be a string or a number. We will see how we can choose an optimal or expand the number of ticks to display on both the x-axis and y-axis.
Axes.set_xticks(self, ticks, minor=False)
Axes.set_yticks(self, ticks, minor=False)
- ticks: This parameter is the list of x-axis/y-axis tick locations.
- minor: This parameter is used whether set major ticks or to set minor ticks
This method does not returns any value.
Example 1: Adjust Number X – Ticks using set_xticks()
In this example, we are setting a number of xticks to the length of data present in dataframe.
Example 2: Adjust Number Y – Ticks using set_yticks()
In this example, we are setting a number of yticks to the length of data present in dataframe.
Example 3: Adjust Number of X and Y Ticks using xticks() and yticks()
In this example, we are setting the number of specific positions of ticks on x-axis and y-axis