[英]How to display the plot.title in top of plot if we are using plot.titile and plot.suptitle together in matlibplot in python
[英]How to write a plot title in more than one line using suptitle in Python?
这是一个例子:
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行中创建此标题?
只需在您想要新行的位置插入换行符\\n
。
import matplotlib.pyplot as plt
fig = plt.figure()
fig.suptitle('This sentence is\nbeing split\ninto three lines')
plt.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.