How to make tick labels font size smaller with Python Matplotlib?

Sometimes, we want to make tick labels font size smaller with Python
Matplotlib.

In this article, we’ll look at how to make tick labels font size smaller with Python Matplotlib.

How to make tick labels font size smaller with Python Matplotlib?

To make tick labels font size smaller with Python Matplotlib, we call tick_params with the labelsize argument.

For instance, we write

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.tick_params(axis='both', which='major', labelsize=10)
ax.tick_params(axis='both', which='minor', labelsize=8)

to call tick_params with the labelsize argument set to the size of the labels on the axes.

Conclusion

To make tick labels font size smaller with Python Matplotlib, we call tick_params with the labelsize argument.