Visual bug with TGraphErrors and TGraphAsymmErrors FillStyle

Dear ROOTers,
Apologies if this point has been raised before, I did not find a similar post on the forum.
I am trying to plot a data histogram together with a few curves of theoretical predictions (TGraphAsymmErrors/TGraphErrors). If I set the fill style of the graphs to SetFillStyle(1001), I believe I am always obtaining the correct graph errors in the displayed range. However, if I have set the style to e.g. SetFillStyle(3154), in the cases the error bars extend outside of the Y-axis plotting range (even if the point is outside of the X-axis range), the uncertainty of the first point is plotted as if it is set to 0.
I attach two image displaying the issue. The brown, yellow and green graphs in the two pictures are the same apart from the fill style. The brown line displays the issue described above, while the other two display a separate issue, which I am currently unable to identify – they look as though there is an additional point on the left of the X-axis range.

I also attach an example script displaying the disappearing error of the first point.
Thank you,
Vangi
ErrorGraphFillStyle.cpp (1.4 KB)

EDIT: The ROOT version I used for the example script is ROOT 6.24/07

If it’s with JSROOT (Web graphics), I’ll let @linev comment, and if it’s with the old graphics, @couet can probably comment on this

EDIT: ROOT 6.24/07 is using old graphics, so it’s for @couet

1 Like

Try first with a more recent ROOT and see if your issue is better or solved; with v6.32.10 I get this from your macro (same in both cases, symm / asymm errors):

The graphs with the 2 fill styles look the same: the x-errors don’t extend outside the outer graph points (compare with using Draw(5, SAME) in the image below), and y-errors seem correct. Cutting the x-errors at the edge points may or may not be what you want, but now the drawing is consistent in both fill styles.

3 Likes

Hello,
Thank you for the reply – I confirm that the behaviour observed in ROOT 6.28/04


is fixed in ROOT 6.34.04

Thank you for the help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.