|
From: Dan K. <ka...@tx...> - 2006-11-09 15:40:54
|
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.
My basic question: Is it possible to remove a data series from a matplotlib
plot?
Longer question:
I'm using matplotlib to generate graph images for an interactive web site.
Through the web site, the user can create a plot and add data series to it.
I'd also like the user to be able to remove a data series. At the moment, I
am accomplishing this by clearing the plot and replotting all the data
series except of course for the one to be removed. This seems inefficient.
So something like:
fig = Figure()
ax = fig.add_subplot(111)
series1 = ax.plot(<some plot parameters here>)
series2 = ax.plot(<some plot parameters here>)
series3 = ax.plot(<some plot parameters here>)
And now I want to remove series2 from the plot.
Is this possible? If it is, can anyone point me to the relevant part of the
user's guide/class library? Or is the best approach to clear the plot and
replot 1 and 3 (and reset all the axes, legends, etc.)
I apologize if this is a FAQ, but as I said, my search for it came up empty.
Thanks,
-Dan
------
ka...@tx...
|