On 07/18/2011 01:03 PM, Eric Firing wrote:
On 07/17/2011 03:47 PM, r-w wrote:
> I have been able to embed a matplotlib simple line graph into a wxpython
> application and then dynamically update the underlying line data.
>
> However, I now want to do something similar with an errorbar plot. I see
> that the errorbar() call returns (/plotline/,/caplines/,/barlinecols/)
> where 'plotline' describes the line part of the plot and the 'caplines'
> and 'barlinecols' describe the error bars and use the Path object.
>
> I just can't see how to change the values underlying the errorbars. I
> need to change the x and y values as well as the yerr values.
>
> Anybody have any idea how to do this? Or should I look at other
> approaches, such a simple line graph and a patch that draws error bars
> 'by hand'?
If you need to update everything, then you probably can't do much better
than to simply clear the axes and call the errorbar method each time you
need to update. That is certainly the easy way--you might as well try
it first.
Eric
Thanks for the tip Eric. It would work but I probably don't want to go
that way as the application I'm working on will have up to 25 line plots
as well as other adornments. But your suggestion lead me to another
approach - put errorbars on a graph as a patch and remove the patch and
create a new patch whenever the errorbar data changes.
I got most of the patch code from the tutorial:
http://matplotlib.sourceforge.net/users/path_tutorial.html
A working example is at:
http://pastebin.com/KMzzFTCi
Not sure if the above approach will work in my 'production' widget, but
I'm on my way!
Thanks,
Ross
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users