Problem with adding an artist from one axes instance to another

"John Hunter" <jdh2358@...287...> writes:

But this fails to plot the first rectange in the resulting plot. The
second, red rectangle is painted correctly in the resulting plot, but
the first one is totaly missing in the plot, leaving only a line in
the plot. Is there some kind of internal status that has to be
resettet in the actors?

When you add an artist to the Axes, it checks to see if you have set a
transformation. If you haven't, it will set the default axes
transformation. If you have, it leaves the transformation unchanged.
This is why you are seeing the problems you see.

Before adding them to the second axes, you need to reset the
transformation for each line, text, etc....

for artist in ax.get_child_artists():
   if isinstance(artist, Line2D):
   elif ....

should work....

It does. It helps me a lot, thank you.



berthold@...1453... / <http://hö>
bhoel@...273... / <;