Fernando,

Thanks, this is exactly what I need.

BTW, I think I missed it in the search because the archive here:

http://sourceforge.net/mailarchive/forum.php?forum_id=33405

doesn't show anything more recent that 10/02/2006.  I'm not sure why this
is.

Thanks again,

-Dan
-----
[EMAIL PROTECTED]


-----Original Message-----
From: Fernando Perez [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 09, 2006 9:46 AM
To: Dan Karipides
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Removing a data series

Hi Dan,

On 11/9/06, Dan Karipides <[EMAIL PROTECTED]> wrote:

> I did my best to search the examples, mailing list, etc. but was surprised
> that I didn't even find this question asked, let alone answered.

Coincidentally it was asked just yesterday by Andrea Gavana, but you
may have missed it in your search (it may have crossed with your
posting time).

> My basic question: Is it possible to remove a data series from a
matplotlib
> plot?

Here is a little self-contained example you can try (N==numpy, P=pylab):

In [24]: x = N.arange(10)

In [25]: fig = P.figure()

In [26]: ax = fig.add_subplot(111)

In [27]: ax.plot(x)
Out[27]: [<matplotlib.lines.Line2D instance at 0x427ce7ec>]

In [28]: ax.plot(x+10)
Out[28]: [<matplotlib.lines.Line2D instance at 0x427ce88c>]

In [29]: ax.plot(x+20)
Out[29]: [<matplotlib.lines.Line2D instance at 0x427ce9ac>]

In [30]: P.show()

In [31]: ax.lines
Out[31]:
[<matplotlib.lines.Line2D instance at 0x427ce7ec>,
 <matplotlib.lines.Line2D instance at 0x427ce88c>,
 <matplotlib.lines.Line2D instance at 0x427ce9ac>]

In [32]: del ax.lines[1]

In [33]: P.show()


This makes the middle line disappear from the plot.

Regards,

f



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to