水平收缩matplotlib寄生轴,以占据大约25%的图像长度

水平收缩matplotlib寄生轴,以占据大约25%的图像长度,matplotlib,axes,shrink,Matplotlib,Axes,Shrink,我有一张像下面这样的图片: 问题是我需要曲线只占图像的25%-30%。换句话说,我需要水平收缩两个寄生虫轴的大小。这可能吗 以下是我到目前为止的情况: """ Plotting _____________________________________________________________________________________________________________ """ fig = plt.figure

我有一张像下面这样的图片:

问题是我需要曲线只占图像的25%-30%。换句话说,我需要水平收缩两个寄生虫轴的大小。这可能吗

以下是我到目前为止的情况:

"""
Plotting _____________________________________________________________________________________________________________
"""
fig = plt.figure(figsize=(20,15))
host1 = host_subplot(211, axes_class=AA.Axes)
plt.subplots_adjust(right=0.75)

#Create custom axes
cax1 = plt.axes(frameon=False)


# Now create parasite axis
par11 = host1.twiny()
par12 = host1.twiny()
top_offset = 50
new_fixed_axis1 = par12.get_grid_helper().new_fixed_axis
par12.axis["top"] = new_fixed_axis1(loc="top",
                                    axes=par11,
                                    offset=(0, top_offset))
par11.axis["top"].toggle(all=True)
par12.axis["top"].toggle(all=True)


# Bottom Axis
bottom_offset1 = -50
bottom_offset2 = -100
par21 = host1.twiny()
par22 = host1.twiny()
new_fixed_axis2 = par21.get_grid_helper().new_fixed_axis
par21.axis["bottom"] = new_fixed_axis2(loc="bottom",
                                        axes=par12,
                                        offset=(0, bottom_offset1))



# Set Host Axis Labels
host1.set_xlabel("UTC Time")
host1.set_ylabel("Elevation (km")

# Set Top Axis Labels
par11.set_xlabel("Sonde Potential Temperature (K)")
par12.set_xlabel("Sonde Relative Humidity %")

vmin, vmax = np.min(chan_1064), np.max(chan_1064)
im = host1.imshow(chan_1064, aspect="auto", cmap=get_a_color_map(), vmin=-2e-4, vmax=0.6e-2,
    extent=(min(xs), max(xs), min(bin_alt_array), max(bin_alt_array)))

scatter = host1.scatter(xs, ys, s=100, color='gold')
host1.set_xlim(min(xs), max(xs))



fig.colorbar(im)

plt.draw()

leg = plt.legend( loc = 'lower right')

# Adjust Fonts
font = {'family' : 'normal',
        'weight' : 'bold',
        'size'   : 12}

mpl.rc('font', **font)

plt.tight_layout()
plt.show()

很抱歉,如果这是一个简单的解决方案,但我一生都无法找到它。

我会用一个插入轴来实现这一点:这正是我所需要的。谢谢