when the same Line2D is plot on two subplots, it disappears on the two subplots

Hi,

I use matplotlib 0.91.2.
When I plot the same Line2D on two subplots, it disappears: execute the
following script:

···

#######################
from pylab import *
ion()
f = figure()
s = f.add_subplot("211")
curve = matplotlib.lines.Line2D([0,1],[0,1],color='m')
s.add_line( curve )
s2 = f.add_subplot("212")
draw()
raw_input('press a key to delete a line to second subplot')
s2.add_line( curve )
s2.lines[-1].figure.canvas.draw()
print s2.lines[-1].get_visible()
raw_input('press a key to quit')
#######################

What is the reason for this behavior?

Thanks

Julien

PS: thanks to Friedrich Hagedorn for his correction of my signature.

--
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1\
+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)

The lines get their transforms from the axes they reside in -- you
can't share a line on multiple axes

···

On Thu, Dec 11, 2008 at 10:19 AM, TP <paratribulations@...185...> wrote:

Hi,

I use matplotlib 0.91.2.
When I plot the same Line2D on two subplots, it disappears: execute the
following script:

#######################
from pylab import *
ion()
f = figure()
s = f.add_subplot("211")
curve = matplotlib.lines.Line2D([0,1],[0,1],color='m')
s.add_line( curve )
s2 = f.add_subplot("212")
draw()
raw_input('press a key to delete a line to second subplot')
s2.add_line( curve )
s2.lines[-1].figure.canvas.draw()
print s2.lines[-1].get_visible()
raw_input('press a key to quit')
#######################

What is the reason for this behavior?