> From: Gianfranco Durin [mailto:g.du...@inrim.it] 
> Sent: Wednesday, November 10, 2010 11:32
> 
> Dear mpl users,
> I have the following problem to solve. Imagine to have the 
> simple example reported on website plotting the errorbars of 
> some x,y data:

...

> and if I change, for instance, y:
> 
> y = y/2.
> 
> I can easily replace the x,y with:
> 
> p[0].set_data(x,y)
> 
> but I do not know how to do the same for the errorbars.

I believe I see how you could do it.  The errorbar call returns the tuple p =
(plotline, caplines, barlinecols) [1], and to update the errorbars, you must
modify the objects in the caplines and barlinecols lists.  Each element of the
caplines list is a Line2D artist [2] for the left, right, top, or bottom caps;
you can use its methods set_data, set_xdata, or set_ydata to modify its
coordinates, as you did for the main line.  Each element of the barlinecols
list is a LineCollection [3] artist responsible for all of the x or y
errorbars; you can use the set_segments method to provide new coordinates.

[1]
http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.error
bar
[2]
http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D
[3]
http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collecti
ons.LineCollection


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to