Multiple error bards with different size

Dear Experts,
I would like to superimpose several 1D plots (TGraphAsymmErrors),
each having different error bar size. How can I implement it ?

Many thanks,

  • Mauro.

TMultiGraph is the standard container for overlaying/tiling TGraphs and derived objects. Try creating a TMultiGraph and Adding your various TGraphAsymmErrors to it.

http://root.cern.ch/root/html/TMultiGraph.html

Jean-François

Dear Jean-François,
many thanks for your prompt answer.

Let’s say I use TMultiGraph, how can I set different error bar size to each of my different TGraphAsymmErrors ?
I know the instruction : gStyle->SetEndErrorSize(5)
But this will change the size to all of them, which is not what I want.

Many thanks,

  • Mauro.

Ah, I thought you meant you just needed different error values on your data points (which is obviously done with the TGraphAsymmErrors itself). You wish to have error bars on superimposed graphs with different sizes of the little lines on the ends of the error bars?

A simple google search turned up this workaround, but I can’t offer any other help in this context.

Hi Jean-François,
yes, I meant exactly : “to have error bars on superimposed graphs with different sizes of the little lines on the ends of the error bars”.
I obviously already tried the link you pointed to me, but the problem is that as soon as I access the canvas,
for example by simply clicking on it, or if I just access the save menu, all error bars are restored to the
same size !

Many thanks.

  • Mauro.

do you have a small macro showing the problem ?

Hi,
here is the .C file.
Once you run the .C file and you try to save the plot in pdf format,
you’ll see that the pdf file contains error bars with same size.

Thanks for your support.

Your macro has only one TExec … so it is normal they end error bars are all the size … you have only one size …

I don’t understand.
If you run the macro you can clearly see two error bars of different size.
If you try to save the file in pdf, you can clearly see that the smaller size
is rescaled to the bigger one.
Probably the smaller size error bars is taken to be the default size, but this
does not make any difference with respect to my original question.

Thanks,

  • Mauro.

In your file you change the End Error bar size only once:

It cannot work … the the 2 sizes you need.