How to Change the Title Font Size in Matplotlib

To change the title font size in Matplotlib, pass fontsize to the title function: plt.title("My title", fontsize=20), or ax.set_title("My title", fontsize=20) when you work with axes. The size can be a number of points or a name like "large". This guide covers the title font size for single plots and subplots, bold titles, the figure title (suptitle), changing it for every plot with rcParams, and the colorbar and legend title sizes.

Tested with Python 3.12.5 and Matplotlib 3.11.2; the charts are real Matplotlib windows. All text options are listed in the Axes.set_title documentation and the Text properties reference.

Change the title font size with plt.title()

import matplotlib.pyplot as plt

months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
visitors = [1200, 1350, 1600, 1580, 1900, 2250]

plt.plot(months, visitors, marker="o")
plt.title("Website visitors per month", fontsize=20)    # font size in points
plt.show()
Matplotlib line chart of monthly website visitors with a large title set by plt.title fontsize=20
plt.title(..., fontsize=20).

fontsize and size are the same argument. Numbers are points (1 pt = 1/72 inch), so the title keeps its physical size when you change the figure size or DPI.

Title font size for subplots with ax.set_title()

With the object-oriented interface each axes has its own title. Set the size and weight per subplot:

import matplotlib.pyplot as plt

fig, axes = plt.subplots(1, 3, figsize=(10, 3.2))
for ax in axes:
    ax.plot([1, 2, 3], [3, 1, 2])

axes[0].set_title("fontsize=10", fontsize=10)
axes[1].set_title("fontsize='x-large'", fontsize="x-large")
axes[2].set_title("Bold, size 16", fontsize=16, fontweight="bold")
plt.tight_layout()
plt.show()
Three Matplotlib subplots whose titles use fontsize 10, fontsize x-large and a bold 16 point title
Numeric sizes, named sizes and fontweight="bold".

Named font sizes and the default title size

Named sizes are relative to rcParams["font.size"] (10 pt by default). The default title size is "large", which is 12 pt. You can also read or change the size of a title after creating it with get_fontsize() and set_fontsize():

import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties

print("axes.titlesize   =", plt.rcParams["axes.titlesize"])
print("figure.titlesize =", plt.rcParams["figure.titlesize"])
print("font.size        =", plt.rcParams["font.size"])
print()
for name in ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"]:
    print(f"{name:>9} = {FontProperties(size=name).get_size_in_points():5.2f} pt")

fig, ax = plt.subplots()
title = ax.set_title("Revenue")
print("\ndefault title size:", title.get_fontsize(), "pt")
title.set_fontsize(18)                       # change an existing title
print("after set_fontsize(18):", title.get_fontsize(), "pt")

Output:

axes.titlesize   = large
figure.titlesize = large
font.size        = 10.0

 xx-small =  5.79 pt
  x-small =  6.94 pt
    small =  8.33 pt
   medium = 10.00 pt
    large = 12.00 pt
  x-large = 14.40 pt
 xx-large = 17.28 pt

default title size: 12.0 pt
after set_fontsize(18): 18.0 pt
Command Prompt output listing Matplotlib named font sizes in points, the default axes.titlesize and a title changed with set_fontsize
Named sizes in points and the default title size, printed in the Command Prompt.

Make the title bold

Add fontweight="bold" (or weight="bold"). Other accepted values include "normal", "light", "semibold", "heavy" or a number from 100 to 900:

plt.title("Quarterly revenue", fontsize=16, fontweight="bold")
ax.set_title("Quarterly revenue", fontsize=16, fontweight="bold")

Figure title font size with suptitle()

fig.suptitle() (or plt.suptitle()) adds one title above all subplots. It takes the same fontsize and fontweight arguments:

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(1, 13)
fig, axes = plt.subplots(1, 2, figsize=(9, 4))
axes[0].plot(x, x * 12 + 50)
axes[0].set_title("Revenue", fontsize=12)
axes[1].plot(x, x * 3 + 20, color="tab:red")
axes[1].set_title("Costs", fontsize=12)

fig.suptitle("2025 financial summary", fontsize=18, fontweight="bold")   # one title for the whole figure
plt.tight_layout()
plt.show()
Matplotlib figure with a large bold suptitle 2025 financial summary above two subplots titled Revenue and Costs
A bold 18 pt figure title above two 12 pt subplot titles.

Set the title font size for all plots with rcParams

To avoid repeating fontsize on every chart, set the defaults once at the top of the script (or in your matplotlibrc file):

import matplotlib.pyplot as plt

plt.rcParams["axes.titlesize"] = 16          # every ax.set_title() / plt.title()
plt.rcParams["axes.titleweight"] = "bold"
plt.rcParams["figure.titlesize"] = 20        # every fig.suptitle()

fig, axes = plt.subplots(1, 2, figsize=(9, 4))
axes[0].bar(["A", "B", "C"], [5, 7, 3])
axes[0].set_title("Orders")                  # no fontsize needed
axes[1].bar(["A", "B", "C"], [2, 4, 6], color="tab:green")
axes[1].set_title("Returns")
fig.suptitle("Set once with rcParams")
plt.tight_layout()
plt.show()
Two Matplotlib bar charts whose bold 16 point titles and 20 point figure title come from rcParams defaults
axes.titlesize, axes.titleweight and figure.titlesize apply to every new title.

To change only one script’s figures temporarily, wrap the plotting code in with plt.rc_context({"axes.titlesize": 16}):.

Font family, color and position with fontdict

Group several font settings in a dictionary and pass it as fontdict. Use loc ("left", "center", "right") and pad to move the title:

import matplotlib.pyplot as plt

title_font = {"family": "serif", "size": 18, "weight": "bold", "color": "darkblue"}

plt.plot([2019, 2020, 2021, 2022, 2023, 2024], [3.1, 2.8, 3.6, 4.2, 4.0, 4.6])
plt.title("GDP growth (%)", fontdict=title_font, loc="left", pad=12)   # loc and pad move the title
plt.show()
Matplotlib chart with a left-aligned dark blue bold serif title set with a fontdict dictionary
A left-aligned serif title set with fontdict, loc and pad.

Colorbar label and title font size

A colorbar is an axes of its own, so its text is set on the colorbar object:

  • cbar.set_label("text", fontsize=14) for the label along the bar,
  • cbar.ax.set_title("text", fontsize=12) for a title above it,
  • cbar.ax.tick_params(labelsize=10) for the tick numbers.
import matplotlib.pyplot as plt
import numpy as np

data = np.random.default_rng(7).normal(20, 5, size=(12, 12))
fig, ax = plt.subplots(figsize=(6.5, 5))
im = ax.imshow(data, cmap="coolwarm")
ax.set_title("Temperature map", fontsize=16)

cbar = fig.colorbar(im, ax=ax)
cbar.set_label("Temperature (°C)", fontsize=14)     # label along the colorbar
cbar.ax.set_title("°C", fontsize=12, pad=8)          # small title above the colorbar
cbar.ax.tick_params(labelsize=10)                    # colorbar tick numbers
plt.show()
Matplotlib heat map with a colorbar whose label, title and tick labels use custom font sizes
Colorbar label (14 pt), colorbar title (12 pt) and tick labels (10 pt).

Legend title font size

plt.legend() has its own title_fontsize for the legend title and fontsize for the entries:

import matplotlib.pyplot as plt

plt.plot([1, 2, 3, 4], [10, 14, 12, 18], label="North")
plt.plot([1, 2, 3, 4], [8, 9, 13, 15], label="South")
plt.title("Sales by region", fontsize=16)
plt.legend(title="Region", title_fontsize=13, fontsize=11)   # legend title and entries
plt.show()
Matplotlib line chart with a legend titled Region using title_fontsize=13 and entries at fontsize 11
title_fontsize=13 for the legend title.

See these related Matplotlib text and label tutorials:

Frequently asked questions

How do I change the title font size in Matplotlib?

Pass fontsize to the title call: plt.title("Title", fontsize=20) or ax.set_title("Title", fontsize=20).

How do I change the font size of ax.set_title()?

Use ax.set_title("Title", fontsize=14). For a title that already exists, call ax.title.set_fontsize(14).

How do I make a Matplotlib title bold?

Add fontweight="bold": plt.title("Title", fontweight="bold"). For all titles, set plt.rcParams["axes.titleweight"] = "bold".

How do I change the suptitle font size?

fig.suptitle("Title", fontsize=18), or set plt.rcParams["figure.titlesize"] for every figure.

What is the default title font size in Matplotlib?

axes.titlesize is "large", which is 12 pt with the default font.size of 10 pt. The suptitle default is also "large".

How do I change the colorbar label font size?

cbar.set_label("Label", fontsize=14) for the label and cbar.ax.tick_params(labelsize=10) for the tick numbers.