In my years of developing data visualizations with Python, I have realized that the default settings are rarely perfect.
Often, the default tick labels are just too small to read on a high-resolution screen or a printed report.
I have spent a lot of time tweaking plots for presentations, and I found that adjusting the font size is usually the first thing I do.
In this tutorial, I will show you how to change the Matplotlib tick label font size using four different methods.
I’ll use a real-world example of US Median Household Income data to make these charts look professional.
Method 1: Use the plt.xticks() and plt.yticks() Functions
The simplest way to change the font size is by using the xticks() and yticks() functions directly from the pyplot module.
I find this method perfect for quick scripts or when I only have one plot to deal with. You simply pass the fontsize argument.
import matplotlib.pyplot as plt
# US Median Household Income Data (Estimated for 2019-2023)
years = [2019, 2020, 2021, 2022, 2023]
income = [68703, 67521, 70784, 74755, 77500]
plt.figure(figsize=(10, 6))
plt.plot(years, income, marker='o', color='#007acc', linewidth=2)
# Changing the tick label font size
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.title('US Median Household Income Growth', fontsize=18)
plt.xlabel('Year', fontsize=16)
plt.ylabel('Income (USD)', fontsize=16)
plt.grid(True, linestyle='--', alpha=0.6)
plt.show()I executed the above example code and added the screenshot below.

In the code above, I used fontsize=14 to make the numbers on the axes stand out. It makes a huge difference in readability.
Method 2: Use the tick_params() Method
When I’m working with the object-oriented interface (which I highly recommend), I prefer using ax.tick_params().
This method is incredibly versatile because it allows you to change both the X and Y axes at once.
import matplotlib.pyplot as plt
# US Annual Inflation Rate (%)
years = [2019, 2020, 2021, 2022, 2023]
inflation = [1.8, 1.2, 4.7, 8.0, 4.1]
fig, ax = plt.subplots(figsize=(10, 6))
ax.bar(years, inflation, color='tomato')
# Using tick_params to set font size for both axes
ax.tick_params(axis='both', which='major', labelsize=12)
ax.set_title('US Annual Inflation Rate (2019-2023)', fontsize=18)
ax.set_xlabel('Year', fontsize=14)
ax.set_ylabel('Inflation Rate (%)', fontsize=14)
plt.show()I executed the above example code and added the screenshot below.

I usually use labelsize inside tick_params because it feels more intuitive when I want to apply the same style to the entire chart area.
Method 3: Change Font Size Globally with rcParams
Sometimes I have five or six charts in a single report, and I don’t want to manually set the font size for every single one.
In those cases, I update the rcParams globally. This ensures every plot I create afterwards follows the same style.
import matplotlib.pyplot as plt
# Setting global tick label size
plt.rcParams['xtick.labelsize'] = 15
plt.rcParams['ytick.labelsize'] = 15
# US Tech Giant Stock Price (Hypothetical)
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May']
prices = [150, 155, 148, 162, 170]
plt.figure(figsize=(10, 6))
plt.plot(months, prices, color='green', linestyle='-', marker='s')
plt.title('Tech Stock Performance (US Market)', fontsize=20)
plt.show()I executed the above example code and added the screenshot below.

By setting xtick.labelsize and ytick.labelsize, I save myself from repeating code in every subplot.
Method 4: Modify Individual Tick Labels
There are rare occasions when I want to highlight a specific part of the axis or have total control over every label object.
I can do this by iterating through the label objects returned by the axes.
import matplotlib.pyplot as plt
# Example: Popular US Programming Languages in 2024
languages = ['Python', 'Java', 'C++', 'JavaScript']
popularity = [45, 20, 15, 20]
fig, ax = plt.subplots(figsize=(10, 6))
ax.barh(languages, popularity, color='skyblue')
# Setting font size individually for each label
for label in ax.get_yticklabels():
label.set_fontsize(16)
label.set_fontweight('bold')
ax.set_title('Top Languages used in US Tech Firms', fontsize=18)
plt.show()Using get_yticklabels() gives me access to the actual text objects, which is great for advanced styling like adding bold weights.
In this tutorial, we looked at several ways to adjust the font size of tick labels in Matplotlib.
Whether you need a quick fix with plt.xticks() or a global change using rcParams, you now have the tools to make your US-based data visualizations look clear and professional.
You may read:
- How to Plot a Matplotlib Secondary Y-Axis with a Log Scale
- How to Plot Multiple Rectangles in Matplotlib
- How to Create Multiple Violin Plots in Matplotlib
- Matplotlib Multiple Circle Plots

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.