Matplotlib make tick labels font size smaller
Here is a code snippet that shows how to make the tick labels font size smaller in Matplotlib:
Here is a code snippet that shows how to make the tick labels font size smaller in Matplotlib:
make the tick labels font size smaller in Matplotlib
import matplotlib.pyplot as plt
# Create a plot
fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4])
# Make tick labels font size smaller
ax.tick_params(axis='both', which='major', labelsize=6)
plt.show()Info
Watch a video course: Python - The Practical Guide
You can adjust the font size by changing the value passed to the labelsize parameter. In this example, the tick labels font size is set to 6.