|
From: John H. <jdh...@ac...> - 2004-03-12 19:10:39
|
>>>>> "Jean-Baptiste" =3D=3D Jean-Baptiste Cazier <Jean-Baptiste.cazier@d=
ecode.is> writes:
Jean-Baptiste> S=E6l ! Is there a way to "turn-off" lines without
Jean-Baptiste> removing the data ? My goal is to hide some lines
Jean-Baptiste> in a plot wihtout losing the data so I can show it
Jean-Baptiste> again later. I can do # Hide the line
Jean-Baptiste> x=3Dline.get_xdata() y=3Dline.get_ydata()
Jean-Baptiste> line.set_data([],[])
This can be done very easily (for any artist) with a minor
modification of artist.py. The base class forewards all drawing to
the derived classes so no other changes are required. Just replace
artist.py with the attached file below and then you can do:
from matplotlib.matlab import *
x =3D arange(0.0, 1.0, 0.05)
l1, l2 =3D plot(x, sin(2*pi*x), x, sin(4*pi*x))
l1.set_visible(False)
show()
|