如何防止标签在matplotlib.mplstyle中被切断

如何防止标签在matplotlib.mplstyle中被切断,matplotlib,Matplotlib,我已经尝试了一段时间,但是我没有发现任何rcparams可以阻止我的xlabel在执行savefig()时从底部被切断。如果我在savefig()之前进行fig.subplot\u调整(底部=0.15)或plt.tight\u layout(),效果会很好,但我更希望默认行为会产生一个漂亮的绘图 也许我的风格有些古怪?但大部分只是从seaborn复制粘贴。我将其包括在下面以供参考: # default seaborn aesthetic # darkgrid + deep palette + n

我已经尝试了一段时间,但是我没有发现任何
rcparams
可以阻止我的xlabel在执行
savefig()
时从底部被切断。如果我在
savefig()
之前进行
fig.subplot\u调整(底部=0.15)
plt.tight\u layout()
,效果会很好,但我更希望默认行为会产生一个漂亮的绘图

也许我的风格有些古怪?但大部分只是从seaborn复制粘贴。我将其包括在下面以供参考:

# default seaborn aesthetic
# darkgrid + deep palette + notebook context

axes.axisbelow: True
axes.edgecolor: black
axes.facecolor: 333333
axes.grid: True
axes.labelcolor: white
axes.labelsize: 18
axes.linewidth: 0
axes.prop_cycle: cycler('color', ['30bbff', 'ff6b51', 'ffc851', '7de524', 'dbdbdb', 'ff00f3'])
axes.titlesize: 24

figure.facecolor: black
figure.figsize: 8.0, 5.5
savefig.dpi: 80

font.family: sans-serif
font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
text.color: white

grid.color: black
grid.linestyle: -
grid.linewidth: 1

image.cmap: Greys

legend.fontsize: 14
legend.frameon: False
legend.numpoints: 1
legend.scatterpoints: 1

lines.linewidth: 2
lines.markeredgewidth: 0
lines.markersize: 7
lines.solid_capstyle: round

patch.facecolor: 4C72B0
patch.linewidth: .3

xtick.color: white
xtick.direction: out
xtick.labelsize: 16
xtick.major.pad: 7
xtick.major.size: 0
xtick.major.width: 1
xtick.minor.size: 0
xtick.minor.width: .5

ytick.color: white
ytick.direction: out
ytick.labelsize: 16
ytick.major.pad: 7
ytick.major.size: 0
ytick.major.width: 1
ytick.minor.size: 0
ytick.minor.width: .5

因为你的标签比平常要大一些,你确实需要在底部留下更多的空间

您可以使用0.11作为底部,而不是默认的
figure.subplot.bottom:

figure.subplot.bottom : 0.15

如果
fig.subplots\u adjust(bottom=0.15)
对您有效,则此功能应能正常工作。否则,进一步增加数字。

是的,就是这样!我不知道允许第二次
访问那么远的参数的语法。现在我知道了!谢谢