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 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to