The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Set fontsize on the Axes title—not on pie(). For example, use ax.set_title("My pie chart", fontsize=16) to give that chart’s title a 16-point font size.
Set the font size for one pie chart
When you create a chart with fig, ax = plt.subplots(), set the title directly on its Axes. Matplotlib describes Axes.set_title as setting a title for the Axes.
As an Amazon Associate I earn from qualifying purchases.
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.pie([40, 35, 25], labels=["A", "B", "C"])
ax.set_title("My pie chart", fontsize=16)
plt.show()
The numeric value gives the title size in points. You can also use a relative size such as "large" instead of a number.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallUse pyplot for the current Axes
If your code uses pyplot’s stateful interface, pass fontsize to plt.title():
#1 Best Overall
plt.pie([40, 35, 25], labels=["A", "B", "C"])
plt.title("My pie chart", fontsize=16)
plt.show()
Matplotlib documents plt.title() as a wrapper for Axes.set_title(). It sets the title on the current Axes. If a figure has multiple Axes, use ax.set_title() to specify which chart receives the title.
Set a default size for Axes titles
To change the default inherited by Axes titles, set axes.titlesize before creating those titles:
Rank #2
plt.rcParams["axes.titlesize"] = 16
This changes the default for Axes titles in the active Matplotlib configuration; it is broader than setting fontsize on one title. See Matplotlib’s customization documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Distinguish an Axes title from a figure title
If the heading you want to resize belongs to the entire figure rather than the pie chart’s Axes, set the figure-level title with fig.suptitle():
Rank #3
fig.suptitle("My figure", fontsize=16)
This controls a different title scope from ax.set_title(). If changing the Axes title size does not affect the visible heading, check whether the code created it with fig.suptitle(). Matplotlib documents this method in its Figure API.
Why plt.pie() has no title font-size argument
plt.pie() draws the pie chart; the title is a separate Axes or figure element. Set its size through the relevant title method’s fontsize keyword, rather than passing a title-size argument to pie(). Passing fontsize directly is the concise option; Matplotlib’s pyplot title API discourages using fontdict.
Quick Recap
Rank #4
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.




