>>>>> "Michael" == Michael <[EMAIL PROTECTED]> writes:
Michael> Hi, I'm new to matplotlib and am very impressed!
Thanks!
Michael> I have a beginner type question:
Michael> In interactive mode (using the GtkAgg backend) I'll plot
Michael> multiple lines on a single subplot. The output got
Michael> clutterred so I was looking for a pylab command to remove
Michael> one of the plot lines but could not find any easy way to
Michael> do this.
Michael> Is this the case? Do I have to clear the current
Michael> axes(cla) and replot all my lines minus the line I don't
Michael> want?
Michael> Something like this would be nice: line_nbr = 3 # delete
Michael> third line on the current axes deleteline(line_nbr)
You have two options -- the axes stores the lines in a plain-ol-list,
and you can manipulate that list like any python list
If you know the line number, ie, the i-th line you've added to the
list
del ax.lines[linenumber]
if you don't know the line number, but have an instance of the line
l, = ax.plot(x, y)
ax.lines.remove(l)
After you've removed the lines, you'll have to force a figure redraw
In pylab, you can simply call
draw()
or using the API, use the figure canvas method
canvas.draw()
The containment relationship is Canvas holds a Figure holds an Axes,
but each child has a pointer to its parent, so if you have access to
an Axes instance
ax.figure.canvas.draw()
JDH
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users