Hello,
I am stacking 3 non-normalized histograms and assign each of them colors. The result is what I am looking for; visible bins with the respective color. Now, whenever I try to scale each histograms before integrating them to the THStack, the resulting plot loses the color and also plots crosses instead of bins. In other words, there are no more rectangular bins but only crosses with the same blue across every histograms. What do I don’t understand about this behaviour?
Here is some code to generate the results:
`
TH1F h1(“H”, “Bleu”, bin_width, bin_min, bin_max), h2(“H”, “Green”, bin_width, bin_min, bin_max),
h3(“H”, “Red”, bin_width, bin_min, bin_max);
// Fill the histograms
…
// Scaling (this step is problematic when I introduce it, the plot is different and
// there are not color differences (every crosses are the same blue across all histograms)
h1.Scale(1/h1.Integral());
h2.Scale(1/h2.Integral());
h3.Scale(1/h3.Integral());
// Assign color
h1.SetFillColor(kBlue);
h2.SetFillColor(kGreen);
h3.SetFillColor(kRed);
THStack hs(“hs”,“Bleu”);
hs->Add(h1);
hs->Add(h2)
hs->Add(h3);
hs->Draw(“nostackb”);
Thank you in advance for your help.
`
ROOT Version: 6.26/06
Platform: Windows 10
Compiler: MSVC 17