Dear experts,
I am having an awkward problem plotting the errors with TGraphErrors , if i use option 3, the result is the one below:
But if i change the option to 1,2 or 5 the errors simply disappear. In the image below is the plot with the option 2;
No more errors, as you can see. So i don’t know what could be happening. There is any other option that would reproduce the same results? I mean, would give me the rectangular error bars? like b instead of 2? I would like to try something like that, or any tips that you may have.
Below is a part of my code if you want to give a look at it:
for jk in range(nHistograms):
errorArray.append( nameArray[jk] + 'error' )
nEntries = ster[jk].GetNbinsX()
xminn = ster[jk].GetXaxis().GetXmin()
xmaxx = ster[jk].GetXaxis().GetXmax()
width = ster[jk].GetXaxis().GetBinWidth(1)
x = array('f') #array['f']
y = array('f') #array['f']
ex = array('f') #array['f']
ey = array('f') #array['f']
for i in range(nEntries):
x.append(xminn + width*i)
y.append(ster[jk].GetBinContent(i))
ey.append(ster[jk].GetBinError(i) + ster[jk].GetBinError(i))
ex.append(0.0)
errorArray[jk] = TGraphErrors( nEntries, x, y, ex, ey )
errorArray[jk].SetLineColorAlpha(0, 0)
errorArray[jk].SetFillStyle(errostyleArray[jk])
errorArray[jk].SetFillColor(errorfillArray[jk])
and for the plot:
>
> for j in range(nHistograms):
> ax1.plot(errorArray[j],"2")
For the .plot() option, i am actually using Atlas Plots. But it’s equivalent to errorArray[j].Draw(“a2”).
Best Regards,
Caio Daumann.




