0

I have an image like the one below: enter image description here

The issue is I need the curves to only take up about 25% - 30% of the image. In other words I need to shrink the size of the two parasite axes horizontally. Is this even possible?

Here is what I have so far:

"""
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()

Sorry if it's a simple solution but, I have not been able to figure it out for the life of me.

p0ps1c1e
  • 176
  • 2
  • 2
  • 14

0 Answers0