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:

#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt

# example data
x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)

# example variable error bar values
yerr = 0.1 + 0.2*np.sqrt(x)
xerr = 0.1 + yerr

# First illustrate basic pyplot interface, using defaults where possible.
plt.figure()
plt.errorbar(x, y, xerr=0.2, yerr=0.4)
================================================
Now I change the last line into:

p = plt.errorbar(x, y, xerr=0.2, yerr=0.4)

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 need to do this as I am implementing a code with a GUI written in PyQt4, and 
I need to quickly replot some data.

Can anyone help me?

Many thanks in advance

Gianfranco Durin

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to