Hello,
I would like to known if it is possible to hide a plot from a graph.
For example, I have the following python code:
for i in range(0,len(self.data):
…
c = np.array(s[i])
self.axes.plot_date(t[i],c,self.colors[i],label=self.labels[i])
…
currently this code “draws” to plots on the canvas. The question is if its possible to hide/unhide a plot while remains the other.
Thaks a lot.
Salvador Benimeli, on 2011-01-13 10:10, wrote:
I would like to known if it is possible to hide a plot from a graph.
For example, I have the following python code:
for i in range(0,len(self.data):
..........
c = np.array(s[i])
self.axes.plot_date(t[i],c,self.colors[i],label=self.labels[i])
.........
currently this code "draws" to plots on the canvas. The question is if its
possible to hide/unhide a plot while remains the other.
Hi Salvador,
yes, it is possible. Just save the list plot_date returns, and
then call set_visible(False) on every member of that list.
lines = plot_date([2000.10,2000.20,2000.30],[1,2,3])
[l.set_visible(False) for l in lines]
or something like this to toggle visibility on and off
[l.set_visible(not l.get_visible()) for l in lines]
best,
···
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7