VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-change-the-font-size-of-the-title-in-a-matplotlib-figure/

⇱ How to change the font size of the Title in a Matplotlib figure ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to change the font size of the Title in a Matplotlib figure ?

Last Updated : 23 Jul, 2025

In this article, we are going to discuss how to change the font size of the title in a figure using matplotlibmodule in Python.

As we use matplotlib.pyplot.title()method to assign a title to a plot, so in order to change the font size, we are going to use the font size argument of the pyplot.title()method in the matplotlib module.  

Example 1: Change the font size of the Title in a Matplotlib

In this example, we are plotting a ReLU function graph with fontsize=40.

Output:

👁 Image
 

Example 2: Set the figure title font size in matplotlib

In this example, we are plotting a sinewave graph with set_size(20).

Output:

👁 change the font size of the title in a figure using matplotlib
 

Example 3: Set the figure title font size in matplotlib

In this example, we are plotting a pie graph with fontsize=10.

Comment