|
From: John H. <jd...@gm...> - 2007-02-07 22:25:38
|
> 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....
JDH
|