- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to increase plt.title font size in Matplotlib?
To increase plt.title font size, we can initialize a variable fontsize and can use it in the title() method's argument.
Steps
Create x and y data points using numpy.
Use subtitle() method to place the title at the center.
Plot the data points, x and y.
Set the title with a specified fontsize.
To display the figure, use show() method.
Example
import numpy as np from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True x = np.linspace(-1, 1, 10) y = x ** 2 fontsize = 12 plt.suptitle("Quadratic Equation", fontsize=fontsize) plt.plot(x, y) plt.title("y=x$^{2}$", fontdict={'fontsize': fontsize}) plt.show()
Output
- Related Articles
- How to increase the font size of the legend in my Seaborn plot using Matplotlib?
- How to increase the font size of text in Arduino IDE?
- How to increase the font size of a Text widget?
- How to modify the font size in Matplotlib-venn?
- How to change xticks font size in a matplotlib plot?
- How to increase the X-axis labels font size using ggplot2 in R?
- How to change the font size of scientific notation in Matplotlib?
- How to set the font size of Matplotlib axis Legend?
- Increase the font size of a paragraph with Bootstrap
- Increase or decrease the size of a font with CSS
- Auto adjust font size in Seaborn heatmap using Matplotlib
- How do I change the font size of the scale in Matplotlib plots?
- How to change font size in HTML?
- How to change font size in ttk.Button?
- How can I change the font size of ticks of axes object in Matplotlib?

Advertisements