October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Hide Y-Axis Tick Labels in Matplotlib

Use Matplotlib’s tick_params to hide left y-axis labels while preserving tick marks, or adjust the setting to remove marks and labels together.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make the left-side y-axis tick labels invisible while keeping the tick marks, use ax.tick_params(axis='y', labelleft=False). Add left=False if you also want to hide the tick marks.

Hide y-axis tick labels but keep the tick marks

With an object-oriented Matplotlib plot, set labelleft=False on the axes:

ax.tick_params(axis='y', labelleft=False)

This hides the left-side y tick labels without hiding the tick marks. The setting applies to major ticks by default. To apply it to both major and minor ticks, specify which='both':

ax.tick_params(axis='y', which='both', labelleft=False)

Choose what to hide

Goal Code Effect
Hide left y tick labels only ax.tick_params(axis='y', labelleft=False) Leaves the tick marks visible.
Hide left y tick labels and tick marks ax.tick_params(axis='y', left=False, labelleft=False) Turns off both marks and labels on the left.
Hide right-side y tick labels ax.tick_params(axis='y', labelright=False) Controls right-side labels separately.
Hide the entire plot axis presentation ax.set_axis_off() Suppresses both axes’ labels, spines, tick marks, tick labels, and grid lines.

Matplotlib exposes tick marks and tick labels as separate settings, so use the narrowest option that matches the intended appearance. The Axes.tick_params API documents these controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why not clear the tick labels or ticks?

ax.set_yticklabels([]) is not the recommended visibility switch. Matplotlib discourages setting tick labels directly because the labels depend on tick positions, and ticks may be recreated during later plotting operations. The set_yticklabels documentation recommends using set_tick_params where possible.

Likewise, plt.yticks([]) and ax.set_yticks([]) remove y ticks rather than merely hiding their labels. In addition, set_yticks replaces the locator with a fixed locator and may expand the view limits to make the requested tick positions visible. See the set_yticks API.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to use set_axis_off()

Use ax.set_axis_off() only when you want the complete axis presentation removed. It hides more than y tick labels: x-axis elements, spines, tick marks, labels, and grid lines are suppressed too. The set_axis_off documentation describes its broader scope.

The stable Matplotlib API documentation identifies version 3.11.2 as of October 4, 2026; API details can change in later releases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.