Modifying histogram from file


I have a number of ROOT files, each of which contains a number of histograms. I created a macro to read in the histograms of interest that plots each of them using THStack.

What I want to do is set a different fill colour for each stacked histogram. However, the SetFillColor is not setting the fill color of the histograms. I have used ForceStyle to no avail. The macro is attached.

Thank you in advance,

hstack_macro.C (1.74 KB)

I was missing the “hist” parameter in the call to Draw(). I achieved what I wanted using:


Yes, when an histogram has errors in its data structure, the default plotting option is “drawn as error bars”. If you want to force the bar chart representation on such histogram you need to force it using the option HIST (as you found out) . :slight_smile: