8-3 调整子图间距

matplotlib.pyplot.subplots_adjust(

left = 0.125 # the left side of the subplots of the figure
right = 0.9 # the right side of the subplots of the figure
bottom = 0.1 # the bottom of the subplots of the figure
top = 0.9 # the top of the subplots of the figure
wspace = 0.2 # the amount of width reserved between subplots,
# as a fraction of the average axis width
hspace = 0.2 # the amount of height reserved between subplots,
# as a fraction of the average axis height
)

# 使用数组方式指定子图
fig, axes = plt.subplots(1, 2, sharey = True)

sns.boxplot(y = ccss.index1a, ax = axes[0])
sns.boxplot(y = ccss.index1b, ax = axes[1])

在这里插入图片描述

# 使用数组方式指定子图
fig, axes = plt.subplots(1, 2, sharey = True)

# 进一步设定图形格式细节
plt.subplots_adjust(top = 0.7, wspace = 0.1)
sns.boxplot(y = ccss.index1a, ax = axes[0])
sns.boxplot(y = ccss.index1b, ax = axes[1])
plt.annotate('现状指数和预期指数的对比', xy = (-1.3, 220), 
             annotation_clip = False, size = 20)

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

juicy-hua

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值