Modern style issue with TAttFill::SetFillStyle

In the previous classic style when one made a THStack of histograms you could set the fill style for different histograms and there would be a white fill between the patterns such that they would not overlap. The new modern style has overlapping patterns and makes the first histogram in the stack inherit all the following histograms patterns and colors. This makes the pattern much less readable.

This is even worse when there are bins with counts only from the first histogram as show below. This I would claim is a mistake as it indicates to the reader that all three histogram somehow contribute to that bin.

I have attached a short demonstration from a modified version of hstack.C
This example is using random gaussian.




TCanvas *hstack1() {
   
   THStack *hs = new THStack("hs","Stacked 1D histograms");
   //create three 1-d histograms
   TH1F *h1st = new TH1F("h1st","test hstack",100,-4,4);
   h1st->FillRandom("gaus",20000);
   h1st->SetFillColor(kRed);
	h1st->SetFillStyle(3002);
   hs->Add(h1st);
   TH1F *h2st = new TH1F("h2st","test hstack",100,-4,4);
   h2st->FillRandom("gaus",15000);
   h2st->SetFillColor(kBlue);
	h2st->SetFillStyle(3003);
   hs->Add(h2st);
   TH1F *h3st = new TH1F("h3st","test hstack",100,-4,4);
   h3st->FillRandom("gaus",10000);
   h3st->SetFillColor(kGreen);
	h3st->SetFillStyle(3004);
   hs->Add(h3st);
   
   TCanvas *cst = new TCanvas("cst","stacked hists",10,10,700,700);
   // in top left pad, draw the stack with defaults
   cst->cd(1);
   hs->Draw();


   return cst;
}

This example shows three histograms with counts in only one bin for each histogram.




[code]TCanvas *hstack() {

THStack *hs = new THStack(“hs”,“Stacked 1D histograms”);
//create three 1-d histograms
TH1F *h1st = new TH1F(“h1st”,“test hstack”,3,0,3);
h1st->SetBinContent(1,10);
h1st->SetFillColor(kRed);
h1st->SetFillStyle(3002);
hs->Add(h1st);
TH1F *h2st = new TH1F(“h2st”,“test hstack”,3,0,3);
h2st->SetBinContent(2,5);
h2st->SetFillColor(kBlue);
h2st->SetFillStyle(3003);
hs->Add(h2st);
TH1F *h3st = new TH1F(“h3st”,“test hstack”,3,0,3);
h3st->SetBinContent(3,2);
h3st->SetFillColor(kGreen);
h3st->SetFillStyle(3004);
hs->Add(h3st);

TCanvas *cst = new TCanvas(“cst”,“stacked hists”,10,10,700,700);
// in top left pad, draw the stack with defaults
cst->cd(1);
hs->Draw();

return cst;
}[/code]

I’ll check

What you see is not connected to the style. I ran your macro with the same root version in both classic and modern style and I get the 2 attached pictures. The fillings look the same. I agree that we can see through the patterns. I will check why.




Which ROOT version are you using? I was using v5-29-02. I still see the difference I originally posted when I switch from the classic style to the modern style though. To change styles I have been using the following

gROOT->SetStyle("modern")
.x hstack1.C
gROOT->SetStyle("classic")
.x hstack1.C

If you execute the macro with the modern style and then change to a classic style using the Style Manger then the see-through fill remains as demonstrated in your two figures.

I am using the latest. I found where it is . I need some time to investigate.
It does not seems to be linked with the new style.

This is now fixed in the svn trunk. Thanks for reporting.