It seems there is no (reliable - see bottom) matplotlib way of doing this, so one is stuck with using image processing tools on the figure-output. I'm using PNGs and PIL for that. Another possibility is using SVGs like here: http://neuroscience.telenczuk.pl/?p=331
That is a related question: matplotlib: can I create AxesSubplot objects, then add them to a Figure instance?
Here is a way that seemed to work in 2012, proposed by Joe Kington:
Axes deliberately aren't supposed to be shared between different
figures now. As a workaround, you could do this
fig2._axstack.add(fig2._make_key(a), a), but it's hackish and likely
to change in the future. It seems to work properly, but it may break
some things.
I haven't tried if it still works.