Strange behaviour with background color of a pad

Dear ROOT team,

I am trying to change the background of a pad on top of which an histo is drawn. It seems simple, it is simple, but it doesn’t work as I expect it :slight_smile:
See this example where I change the background of the pad before drawing the histo, draw the histo, and change back the color :

root [0] TCanvas c root [1] TH1F *h = new TH1F("adsf", "adsf", 100, 0, 99) root [2] gPad->SetFillColor(43) root [3] h->Draw() root [4] gPad->SetFillColor(19) root [5] gPad->Modified()

The result is a grey pad with a coloured histogram (see picture). I would expect that

  1. the histo’s color is never changed (as when you draw first the histo and then change the color of the pad)
  2. the histo’s color is at least changed back at step 4…


What do you think ?
Thanks
Barth

Yes, I agree it is not very consistent.
Any way the right way is:

{
   TCanvas *c1 = new TCanvas("c1", "c1",15,48,700,502);
   c1->SetFillColor(5);
   c1->SetFrameFillColor(50);
   TH1F *adsf = new TH1F("adsf","adsf",100,0,99);
   adsf->Draw("");
}

Thank you for your answer. SetFrameFillColor solves my problem !

Cheers,
Barth