Unexpected behavior of DrawOption("F")

Root version: 6.24/00 from LCG100

I am plotting the result of a fit which consists of some signal PDF and the exponential background. The latter component is plotted with DrawOption(“F”) to have a filled orange shape:

total->plotOn(Jpsi_frame, Components(exp_pdf),FillStyle(1001),VLines(),DrawOption("F"),FillColor(kOrange-4),LineColor(kOrange-4),Name("comb"));

Instead, only a part of the shape is orange while the rest remains white (see the attached pdf file).
I know various versions of similar issues have been raised/solved here in the past, but nevertheless this problem occurs in 6.24. Am I missing some plotting arguments or is this a bug?
Minimal example attached.

example.C (1.9 KB)
fit_example.pdf (19.3 KB)

This plot is a RooCurve which is a TGraph. When you draw a TGraph as filled polygon you use the F option described here. Ie: a polygon is drawn by connecting the last and the first point of the graph. That’s what you see. To fill the area below the curve you would need to add extra points. I am not sur this is foreseen by RooCurve. May be @moneta knows.

Thanks for your reply. The documentation however says “If a filled style is selected, also use VLines() to add vertical downward lines at end of curve to ensure proper closure” so presumably that should have taken care of closing the polygon. Which is apparently not the case?

I removed VLines() And I think the plot I got is I think what you are looking for:

I would have thought the opposite …
There is a problem with this VLines. I will check with @moneta

This was a bug. A PR is on the way: The option VLines in plotOn was not implemented properly by couet · Pull Request #8198 · root-project/root · GitHub
The same issue can be seen here: ROOT: tutorials/roostats/rs701_BayesianCalculator.C File Reference

Thanks for the quick fix!
After the fix, does this also work properly for plots in the log scale? Thanks.

Yes I tested with ROOT: tutorials/roostats/rs701_BayesianCalculator.C File Reference and both plots are fine after this fix (the bottom one is in log scale).

1 Like

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