|
From: <bh...@de...> - 2007-02-08 18:04:09
|
"John Hunter" <jd...@gm...> 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(): > artist.set_transform(ax2.transData) > if isinstance(artist, Line2D): > ax2.add_line(artist) > elif .... > > should work.... It does. It helps me a lot, thank you. Regards Berthold --=20 ber...@xn... / <http://h=C3=B6llmanns.de/> bh...@we... / <http://starship.python.net/crew/bhoel/> |