Histogram Fill Style/Color

I’m having problems changing the fill color and style of a histogram. A colleague of mine sent me a root file containing a TCanvas, from which I grabbed a histogram, TH1F. However, no matter what I do, I can’t seem to change the fill style or drawing options of the histogram itself. The only things I can change are the marker size/style/color. I would really like to change the points to a curve or line, and also fill it.

I’ve tried the standard method I always use (explained here: TAttFill at root.cern.ch/root/html/TAttFill.html ) but to no avail.

I’m guessing it has something to do with the way the histogram is taken from the TCanvas, since I do this fairly often with histograms I create myself and have never had any problems.

Any ideas?

I apologize in advance if this has been answered before, but I did look and could not find anything.

put gROOT->ForceStyle(); in your rootlogon.C

Thanks for the response, but this did not work.

I’ve attached a sample macro, but I’m not sure if this will help. Maybe you need the root file that the macro read in?
example.C (1.26 KB)

yes

Thanks again for the quick response. Here is a slightly updated macro (that should work!) and the root file.
file1.root (34.8 KB)
example.C (1.29 KB)

        C12->SetFillStyle(3001);
        C12->SetFillColor(kRed);
        C12->Draw( "hist same");

See the option HIST documentation.

That worked. Thanks very much!