Hi,
I bumped into this weird problem that drawing a THStack gives some unwanted fill color for one of the histogram. I managed to trace it to a custom palette being set in my .rootlogon.C through TColor::CreateGradientPalette. The attached macro bugTHStack.C reproduces the problem in a standalone fashion.
Here are the different ways I found to make the problem disappear in the standalone macro:
- remove the gROOT->SetStyle(“Plain”)
- use a NColors <= 76 (the unwanted fill color seems to depend on the NColors parameter somehow). I attached a normal THStack plot (cst_76.png with NColors=76) as well as a pathological one (cst_77.png with NColors=77)
- remove the TColor::CreateGradientPalette call
Note that you can also use TH1F::SetFillColor(color) to get rid of this strange behaviour except that it does not work when color is kWhite. Also the problem does not show up if you use the “nostack” option when drawing the THStack.
Cheers,
Loïc
bugTHStack.C (898 Bytes)