Change the appearance of ticks, tick labels, and gridlines.
Tick properties that are not explicitly set using the keyword arguments remain unchanged unless reset is True.
The axis to which the parameters are applied.
The group of ticks to which the parameters are applied.
Whether to reset the ticks to defaults before updating them.
Puts ticks inside the axes, outside the axes, or both.
Tick length in points.
Tick width in points.
Tick color.
Distance in points between tick and label.
Tick label font size in points or as a string (e.g., 'large').
Tick label color.
Tick color and label color.
Tick and label zorder.
Whether to draw the respective ticks.
Whether to draw the respective tick labels.
Tick label rotation
Gridline color.
Transparency of gridlines: 0 (transparent) to 1 (opaque).
Width of gridlines in points.
Any valid Line2D
line style spec.
ax.tick_params(direction='out', length=6, width=2, colors='r', grid_color='r', grid_alpha=0.5)
This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent.
matplotlib.axes.Axes.tick_params
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axes.Axes.tick_params.html