O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying tick mark locations and tick labels

The location and rendering of tick marks can be customized using various functions. The following code walks you through several examples of controlling their values and rendering.

The values that pandas decides to use at label locations can be found using the plt.xticks() function. This function returns two values: the values at each tick and the objects representing the actual labels:

This tick array contains the locations of the ticks in units of the actual data along the x-axis. In this case, pandas has decided that a range of 0 through 4 (the min and max) and an interval of 0.5 are appropriate. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required