user3261475
user3261475

Reputation:

How to write a plot title in more than one line using suptitle?

Here is an example:

fig.suptitle('Lorem ipsum dolor sit amet, consectetur adipiscing elit donec nec condimentum libero. Phasellus condimentum porttitor congue morbi eget quam sed justo egestas lobortis aenean et erat metus')

How to make this title in 3 lines?

Upvotes: 12

Views: 28007

Answers (1)

Ronny Andersson
Ronny Andersson

Reputation: 1697

Just insert a newline character \n where you want the new line.

import matplotlib.pyplot as plt
fig = plt.figure()
fig.suptitle('This sentence is\nbeing split\ninto three lines')
plt.show()

Upvotes: 25

Related Questions