以下是一个例子:
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')
如何在3行中创建此标题?
答案 0 :(得分:7)
只需在换行符号\n
处插入换行符即可。
import matplotlib.pyplot as plt
fig = plt.figure()
fig.suptitle('This sentence is\nbeing split\ninto three lines')
plt.show()