ROOT6 SetFillColor does not fill histogram

Hi!

I have a similar issue to the one found here.
However the there proposed solution does not work for me:

 TH1F *h = new TH1F("h", "Something?", 100, -3, 3);
  h->SetLineColor(kRed);
  h->SetFillStyle(3001);
  h->SetFillColor(3);
  for (Int_t i = 0; i < 10000; i++)
    h->Fill(gRandom->Gaus(0,1), gRandom->Gaus(0,1));
  h->Draw("HIST");

The line becomes red, but the area won’t get filled! Please let me know if you need more information. Any help is welcomed!

Debus


I use a self compiled ROOT 6.08/06 (2017-03-02); CMakeCache.txt.

Your macro gives me the attached plot with ROOT 6.09/01.

You can also try:

{
   TH1F *h = new TH1F("h", "Something?", 100, -3, 3);
   h->SetLineColor(kRed);
   h->SetFillStyle(1001);
   h->SetFillColor(3);
   for (Int_t i = 0; i < 10000; i++)
   h->Fill(gRandom->Gaus(0,1), gRandom->Gaus(0,1));
   h->Draw("HIST");
}

Thanks for your suggestion.

However, your example does not work for me either, it still lacks the filling. I guess it has something to do with a build problem! :frowning:

If I find the reason or a solution I will tell you.

Cheers

I could solve this problem by using UXA instead of SNA for my Intel HD graphics card:

usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "AccelMethod"  "uxa"
    # Option      "AccelMethod"  "sna"
  EndSection

Cheers

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