I am trying to use the Paint2DErrors() funtion in the following way:


where h_Ratio1 is a TH2F. This gives me an error:

Can’t Call h_Ratio1->Paint2DErrors("") in current scope.

I have also tried h_Ratio1->Draw2DErrors(""); which gives the same result.

Any idea what I am doing wrong?

Thanks, Claire

HistPainter::Paint2DErrors is called automatically when you draw a TH2 using option “E”. Why do you want to call it directly ? do you have an example ?


Thanks this helps.
I want to produce a 2D lego plot with just the errors rather then the absolute values, I thougt this was what the Paint2D errors did, I thought it gave you a 2D histogram with the errors in each 2D bin. How do I produce this plot?




But this still gives error bars floating at the absolute values. I want to plot a 2D hist where the height is the error. For example, if the error in bin[1][1] is +/-0.5, I want a block of height 0.5. In my study it is the statistical error that’s important not the value in the bin. How do I produce this plot?

Thanks very much for your help

In that case you should loop on the histogram, get the error for each bin, fill a new histogram (with the same size as the original one) with the error at each bin, and plot the result as a lego.

Thanks, I wanted to check there wasn’t an automatic way of doing it. You’ve been really helpful.