How to change the font size of the Title in a Matplotlib figure ? Last Updated : 26 Aug, 2022 Comments Improve Suggest changes Like Article Like Report In this article, we are going to discuss how to change the font size of the title in a figure using matplotlib module 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. Python3 # importing module import matplotlib.pyplot as plt # assigning x and y coordinates x = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5] y = [] for i in range(len(x)): y.append(max(0, x[i])) # depicting the visualization plt.plot(x, y, color='green') plt.xlabel('x') plt.ylabel('y') # displaying the title plt.title("ReLU Function", fontsize = 40) Output: Â Example 2: Set the figure title font size in matplotlib In this example, we are plotting a sinewave graph with set_size(20). Python3 import numpy as np import matplotlib.pyplot as plt xaxis=np.linspace(0,5,100) yaxis= np.sin(2 * np.pi * x) axes = plt.gca() plt.plot(xaxis, yaxis) axes.set_title('Plot of sinwave graph') axes.set_xlabel('X - Axis') axes.set_ylabel('Y - Axis') axes.title.set_size(20) plt.show() Output: Â Example 3: Set the figure title font size in matplotlib In this example, we are plotting a pie graph with fontsize=10. Python3 # importing modules from matplotlib import pyplot as plt # assigning x and y coordinates foodPreference = ['Vegetarian', 'Non Vegetarian', 'Vegan', 'Eggitarian'] consumers = [30, 100, 10, 60] # depicting the visualization fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1]) ax.axis('equal') ax.pie(consumers, labels = foodPreference, autopct='%1.2f%%') # displaying the title plt.title("Society Food Preference", fontsize = 10) Output: Â Comment More infoAdvertise with us Next Article How to change the font size of the Title in a Matplotlib figure ? R riturajsaha Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2020 Python-matplotlib Practice Tags : python Similar Reads How to Change the Size of Figures in Matplotlib? Matplotlib provides a default figure size of 6.4 inches in width and 4.8 inches in height. While this is suitable for basic graphs, various situations may require resizing figures for better visualization, presentation or publication. This article explores multiple methods to adjust the figure size 3 min read How to Change the Font Size of Colorbars in Matplotlib Matplotlib is a powerful and widely used library in Python for data visualization. It offers a variety of plotting functions to create complex graphs and charts. One common visualization is a heatmap, which often includes a color bar to indicate the scale of values represented by colors. Adjusting t 4 min read How to Change the Figure Size with Subplots in Matplotlib Matplotlib is a powerful plotting library in Python that allows users to create a wide variety of static, animated, and interactive plots. One common requirement when creating plots is to adjust the figure size, especially when dealing with subplots. This article will guide you through the process o 4 min read How to change the size of axis labels in Matplotlib? Matplotlib is a Python library that helps in visualizing and customizing various plots. One of the customization you can do is to change the size of the axis labels to make reading easier. In this guide, weâll look how to adjust font size of axis labels using Matplotlib.Letâs start with a basic plot 2 min read How to Set a Single Main Title for All the Subplots in Matplotlib? A title in Matplotlib library describes the main subject of plotting the graphs. Setting a title for just one plot is easy using the title() method. By using this function only the individual title plots can be set but not a single title for all subplots. Hence, to set a single main title for all su 2 min read Like