As a developer, while working on a Python data visualization project for a U.S.-based retail analytics dashboard, I needed to create multiple subplots using Matplotlib. The charts looked great, but I quickly realized that the tick labels on each subplot made the figure cluttered and hard to read.
If you use Matplotlib often, you’ve probably faced this too: when you create multiple subplots, each one comes with its own tick labels. While that’s useful in some cases, it can also make your visualization look messy, especially when the subplots share the same axes.
In this tutorial, I’ll show you how to remove tick labels from subplots in Matplotlib using Python. I’ll walk you through multiple methods, from using simple built-in functions to more flexible approaches using tick_params() and loops.
What Are Tick Labels in Matplotlib?
Before we dive into the code, let’s quickly understand what tick labels are.
In Matplotlib, tick labels are the numeric or text values displayed along the X and Y axes. They help users understand the scale of the data. However, in subplots, especially when you’re comparing multiple datasets, these labels can become repetitive.
Removing tick labels doesn’t remove the ticks themselves; it just hides the text. You can still keep the ticks for alignment or remove them entirely, depending on your design needs.
Method 1 – Remove Tick Labels Using set_xticklabels() and set_yticklabels()
One of the simplest ways to remove tick labels in Matplotlib is by setting them to an empty list using set_xticklabels([]) and set_yticklabels([]).
Let me show you how I do this in Python using a real example.
Example:
import matplotlib.pyplot as plt
import numpy as np
# Sample data for U.S. sales trends
x = np.arange(1, 6)
y1 = np.random.randint(100, 500, size=5)
y2 = np.random.randint(200, 600, size=5)
# Create two subplots
fig, axes = plt.subplots(1, 2, figsize=(10, 4))
# Plot data
axes[0].plot(x, y1, color='blue', marker='o')
axes[0].set_title('2025 Q1 Sales - East Coast')
axes[1].plot(x, y2, color='green', marker='o')
axes[1].set_title('2025 Q1 Sales - West Coast')
# Remove tick labels from both subplots
axes[0].set_xticklabels([])
axes[0].set_yticklabels([])
axes[1].set_xticklabels([])
axes[1].set_yticklabels([])
plt.tight_layout()
plt.show()You can see the output in the screenshot below.

In this example, I created two subplots showing quarterly sales data for the East and West Coast regions. By setting the tick labels to empty lists, I removed all tick text while keeping the tick marks visible.
This method is quick and works perfectly when you only need to hide tick labels temporarily.
Method 2 – Remove Tick Labels Using plt.setp()
Another method I often use is the plt.setp() function. It’s a concise way to modify multiple subplot properties at once, including tick labels.
Example:
import matplotlib.pyplot as plt
import numpy as np
# Generate random data
x = np.linspace(0, 10, 100)
y1 = np.sin(x)
y2 = np.cos(x)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4))
ax1.plot(x, y1, color='red')
ax1.set_title('Sine Wave')
ax2.plot(x, y2, color='purple')
ax2.set_title('Cosine Wave')
# Remove tick labels using plt.setp
for ax in [ax1, ax2]:
plt.setp(ax.get_xticklabels(), visible=False)
plt.setp(ax.get_yticklabels(), visible=False)
plt.tight_layout()
plt.show()You can see the output in the screenshot below.

Here, I used plt.setp() to set the visibility of tick labels to False. This is a clean and flexible approach, especially when you’re working with multiple subplots in a loop.
Method 3 – Remove Tick Labels Using tick_params()
The tick_params() method is one of the most powerful tools in Matplotlib for customizing ticks and labels. You can use it to hide tick labels, ticks, or both.
Example:
import matplotlib.pyplot as plt
import numpy as np
# Simulated U.S. housing market data
months = np.arange(1, 13)
prices = np.random.randint(250000, 500000, size=12)
rent = np.random.randint(1200, 2500, size=12)
fig, axes = plt.subplots(2, 1, figsize=(8, 6))
axes[0].plot(months, prices, color='orange', marker='o')
axes[0].set_title('Average Home Prices in 2025')
axes[1].plot(months, rent, color='teal', marker='s')
axes[1].set_title('Average Rent Prices in 2025')
# Remove tick labels using tick_params
for ax in axes:
ax.tick_params(labelbottom=False, labelleft=False)
plt.tight_layout()
plt.show()You can see the output in the screenshot below.

In this example, I used labelbottom=False and labelleft=False to remove both X and Y tick labels. This approach is great when you want to keep the ticks but remove only the labels for a cleaner look.
Method 4 – Remove Tick Labels Using ax.label_outer()
When you’re using shared axes in subplots, the label_outer() method is a smart choice. It hides tick labels for inner subplots while keeping the outer ones visible.
Example:
import matplotlib.pyplot as plt
import numpy as np
# Simulated temperature data for major U.S. cities
days = np.arange(1, 8)
ny_temp = np.random.randint(60, 85, size=7)
la_temp = np.random.randint(65, 90, size=7)
chicago_temp = np.random.randint(55, 80, size=7)
fig, axes = plt.subplots(3, 1, sharex=True, figsize=(8, 8))
axes[0].plot(days, ny_temp, color='blue', marker='o', label='New York')
axes[1].plot(days, la_temp, color='green', marker='s', label='Los Angeles')
axes[2].plot(days, chicago_temp, color='red', marker='^', label='Chicago')
for ax in axes:
ax.legend()
ax.label_outer()
plt.tight_layout()
plt.show()You can see the output in the screenshot below.

This method is especially useful when you’re working with multiple rows or columns of subplots that share the same X or Y axis. It automatically removes inner tick labels, keeping your figure neat and readable.
Method 5 – Remove Tick Labels Using Loops and Conditions
Sometimes, you may want to remove tick labels only from specific subplots. In that case, you can use a loop with conditions to target certain axes.
Example:
import matplotlib.pyplot as plt
import numpy as np
# Simulated population growth data
years = np.arange(2010, 2025)
data = [np.random.randint(1_000_000, 5_000_000, size=15) for _ in range(4)]
fig, axes = plt.subplots(2, 2, figsize=(10, 6))
for i, ax in enumerate(axes.flat):
ax.plot(years, data[i], marker='o')
ax.set_title(f'Region {i+1}')
# Remove tick labels from all but the bottom-right subplot
if i != 3:
ax.set_xticklabels([])
ax.set_yticklabels([])
plt.tight_layout()
plt.show()This approach gives you complete control over which subplots display tick labels. It’s perfect for dashboard-style visualizations where you want to highlight one main chart and simplify the rest.
Bonus Tip – Remove Tick Marks Entirely
If you want to remove both tick labels and tick marks, use the following line inside your loop or for a single axis:
ax.tick_params(bottom=False, left=False, labelbottom=False, labelleft=False)This completely removes both the ticks and their labels, leaving a clean, minimalist subplot, ideal for presentations or infographics.
As you can see, Matplotlib gives us several ways to remove tick labels from subplots in Python. Depending on your use case, you can choose between simple methods like set_xticklabels([]) or more advanced ones like tick_params() and label_outer().
Personally, I prefer tick_params() for its flexibility; it allows me to control both ticks and labels in one place. However, when I’m working with shared axes, label_outer() saves me a lot of time.
By cleaning up your tick labels, you make your plots more readable, professional, and presentation-ready. Whether you’re building a Python dashboard for a U.S. client or preparing a report for internal analytics, these techniques will help you create visually appealing subplots with ease.
You may like to read other Matplotlib:
- How to Rotate and Align Tick Labels in Matplotlib
- How to Rotate Date Tick Labels in Matplotlib
- How to Remove Tick Marks in Matplotlib
- Matplotlib Remove Colorbar and Specific Tick Labels

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.