Take a row from TH3D put it in TH1D display with error

Hi,

I use this way to get a row of bins from TH3D:

initialBin=hist3D.GetBin(1,biny/2,binz/2)
valuesOnX=[]
for i in xrange(0,binx):
    valuesOnX.append(hist3D.GetBinContent(initialBin+i))

After putting these into a TH1D would I be able to display the correct error bars?

If not then what would be the way to do this?

I think I got it:

[code]initialBin=hist3D.GetBin(1,biny/2,binz/2)
rootValX=r.TH1D(“valsX”,“Distribution drawn with error bars (option E1)”, binx, minx, maxx)
valuesOnX=[]
for i in xrange(0,binx):
valuesOnX.append(hist3D.GetBinContent(initialBin+i))
rootValX.SetBinContent(i+1 ,hist3D.GetBinContent(initialBin+i))

r.gStyle.SetEndErrorSize(3)
r.gStyle.SetErrorX(1.)
rootValX.SetMarkerStyle(20)[/code]

What do the horizontal error bars mean here?


Hi,

The errors in X are just the bin width, by default half of the bin width (when gStyle->SetErrorX(0.5) )
In case of an histogram they should then not considered as uncertainty on the X values.

Lorenzo