twiny and AxisDivider

I’m trying to do a twiny setup on one of the Axes generated from a make_axes_locatable().append_axes() call. The new axis generated from twiny() seems to span the entire window though. Here’s the code:

from matplotlib.pyplot import *

import numpy as np

from mpl_toolkits.axes_grid1 import make_axes_locatable

ax_c = subplot(111)


divider = make_axes_locatable(ax_c)

ax_t = divider.append_axes(“top”, size=1.2, pad=0.1, sharex=ax_c)

ax_r = divider.append_axes(“right”, size=1.2, pad=0.1, sharey=ax_c)



ax_ty = ax_r.twiny()



If you get the idea of what I’m trying to do, other suggestions involving AxesGrid, subplots, or otherwise are welcome. AxesGrid seems to require that I have all four plots in a 2x2 grid (in the above code there are only 3), and using subplots would seemingly require the rightmost plot to span the height of the other two. There’s this: but I don’t want to hard-code the dimensions, as the center subplot should change dimensions as I put in new data…