I am following this discussion to produce a plot in which report different data sets whose x-axis is the same, but y-axis has different scales. I can reproduce my plot, similar to this:
With some code:
# Twin the x-axis twice to make independent y-axes.
axes = [ax, ax.twinx(), ax.twinx()]
# Make some space on the right side for the extra y-axis.
fig.subplots_adjust(right=0.75)
# Move the last y-axis spine over to the right by 20% of the width of the axes
axes[-1].spines['right'].set_position(('axes', 1.2))
# To make the border of the right-most axis visible, we need to turn the frame
# on. This hides the other plots, however, so we need to turn its fill off.
axes[-1].set_frame_on(True)
axes[-1].patch.set_visible(False)
But it happens that, by side the figure, there is plenty of empty room, so that the figure is "squeezed" in 3/4 of the sheet, instead of being spread over the whole page.
Why does this happen? And what could be a possible way to avoid it?