How to write a plot title in more than one line using suptitle?
Question:
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?
Answers:
Just insert a newline character n
where you want the new line.
import matplotlib.pyplot as plt
fig = plt.figure()
fig.suptitle('This sentence isnbeing splitninto three lines')
plt.show()
import matplotlib.pyplot as plt
plt.title(r'This plot title is''n displayed in two rows')
plt.show()
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?
Just insert a newline character n
where you want the new line.
import matplotlib.pyplot as plt
fig = plt.figure()
fig.suptitle('This sentence isnbeing splitninto three lines')
plt.show()
import matplotlib.pyplot as plt
plt.title(r'This plot title is''n displayed in two rows')
plt.show()