How to draw a graph with error bars in a tree

i have a tree px ,py ,exl, exh,eyl, eyh.
how can i draw the graph with error bars.

my date file format is:

px py exl exh eyl eyh

12.193 0.944828 0.023 0.011 0.0551724 0.0551724
15.4386 0.789655 0.011 0.003 0.0517241 0.0517241

is there a better method to read the file and draw the graph with errorr?
thanks!

s there a better method …

“better” than what ?

TGraphWithErrors is what you need. Just read docs and look at samples. It’s easy:

make 4 arrays of same size, x,y, err_x, err_y

fill them in and then create graph with errror bars.

What’s the problem exactly ?

graph Error is good