It goes deeper -- even Figure.add_axes() returns an old
> Axes instance if the rect given has been seen before. I'd
> argue that people delving into the OO innards of
> matplotlib should be able to handle keeping a reference to
> instances of Axes they've created. Can we change this
> behavior or would it cause massive breakage somewhere?
This used to be handled in pylab helpers, but because there was some
desire for OO matplotlib and pylab to have the same functionality, and
to simplify the code, I moved the current axes handling into the
figure class. The core of the current axes handling is what is
causing the problem you have.
Did you see this in the add_axes docstring
Eg, if you want two axes that are
otherwise identical to be added to the axes, make sure you give them
Ie, the problem and the workaround are explicitly mentioned in the
add_axes docs, and since the functionality is fairly core, I am
inclined to leave it. One might do
for i,data enumerate(mydata):
a = fig.add_axes(somerect, label='axes%d'%i)
and then update some rect later.