在matplolib中增加标题和剧情之间的距离? [英] Increase distance between title and plot in matplolib?
本文介绍了在matplolib中增加标题和剧情之间的距离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在matplotlib中有一个简单的绘图,我想增加标题和绘图之间的距离(不使用suptitle
,因为它不适用于我在服务器上使用的版本).该怎么做?
I have a simple plot in matplotlib and I would like to increase the distance between the title and the plot (without using suptitle
because it does not work on the version I use on a server). How to do that ?
推荐答案
似乎没有一种直接设置此设置的干净方法(但可能值得添加一个功能请求),但是标题只是一个text
艺术家,因此您可以进入并进行更改.
There doesn't seem to be a clean way to set this directly (but might be worth a feature request to add that), however the title is just a text
artist, so you can reach in and change it.
#ax = plt.gca()
ttl = ax.title
ttl.set_position([.5, 1.05])
#plt.draw()
应该可以解决问题.根据自己的喜好调整1.05
.
should do the trick. Tune the 1.05
to your liking.
这篇关于在matplolib中增加标题和剧情之间的距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文