Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk2 min

Matplotlib Subplot Titles: Change Font Size and Make Text Bold

Use Axes.set_title() with fontsize and fontweight="bold" to style one subplot title; use Figure.suptitle() for a whole-figure heading.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To change an individual Matplotlib subplot title’s size and weight, pass fontsize and fontweight to ax.set_title():

ax.set_title("Sales by region", fontsize=16, fontweight="bold")

Use fig.suptitle() for a heading across the whole figure, or Matplotlib’s axes.titlesize and axes.titleweight settings to establish defaults for Axes titles.

Style one subplot title

Call set_title() on the Axes whose title you want to change. Its fontsize and fontweight keyword arguments accept standard text properties:

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 2, 5])
ax.set_title("Sales by region", fontsize=16, fontweight="bold")

plt.show()

This styles only that Axes title. The method returns the title’s Text instance, which can be useful if you want to adjust the text object afterward. See the Matplotlib Axes.set_title API reference.

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

Choose the right title scope

What you want to title Method Example
One subplot (one Axes) ax.set_title() ax.set_title("Sales", fontsize=16, fontweight="bold")
The whole figure fig.suptitle() fig.suptitle("Quarterly results", fontsize=18, fontweight="bold")

A figure supertitle is centered at the Figure level, above the individual Axes titles. It does not replace them. The Figure API reference documents Figure.suptitle.

Set default size and weight for Axes titles

If many plots should share the same title styling, configure Matplotlib’s rcParams instead of repeating the same keywords in every call:

import matplotlib as mpl

mpl.rcParams["axes.titlesize"] = 16
mpl.rcParams["axes.titleweight"] = "bold"

These values establish defaults for Axes titles. An explicit keyword in a particular set_title() call can give that title a different appearance. Defaults can also vary with the active style or user configuration. Matplotlib’s customization guide covers rcParams and style sheets.

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

Adjust title position and alignment

Axes.set_title() also accepts loc to align a title in the center, left, or right. Use pad to adjust the gap above the Axes in points, or y to set its vertical position. If y is omitted, Matplotlib chooses a position intended to avoid overlapping Axes decorations.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ax.set_title(
    "Sales by region",
    fontsize=16,
    fontweight="bold",
    loc="left",
    pad=12,
)

Pass text properties as individual keywords, as above, or unpack a dictionary of properties. The current API reference does not recommend fontdict as the preferred way to set them.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.