How to h->Draw("E4") with the body filled in

Hello,

I am plotting a 1-d histogram (TH1F) using the “E4” command as done below.

{ TCanvas *ce4 = new TCanvas("ce4","ce4",600,400); TH1F *he4 = new TH1F("he4","Distribution drawn with option E4",100,-3,3); Int_t i; for (i=0;i<10000;i++) he4->Fill(gRandom->Gaus(0,1)); he4->SetFillColor(kRed); he4->GetXaxis()->SetRange(40,48); ce4->cd(1); he4->Draw("E4"); ce4->cd(2); }

However, I’d like to fill in the body of the histogram in kBlue. The closest I can think of is doing

he4->SetFillColor(kBlue) ; 
he4->DrawCopy("HIST,SAME") ;

but then I get an ugly blocky histogram and not a smoothed curve. Does anyone know how to draw a smoothed filled histogram?

thanks,
Tae Min

I suggest this (but I am not sure what you are trying to achieve)

{
   TCanvas *ce4 = new TCanvas("ce4","ce4",600,400);
   TH1F *he4 = new TH1F("he4","Distribution drawn with option E4",100,-3,3);
   Int_t i;
   for (i=0;i<10000;i++) he4->Fill(gRandom->Gaus(0,1));
   he4->SetFillColor(kBlue);
   he4->GetXaxis()->SetRange(40,48);
   he4->DrawCopy("HIST");

   TH1 *he4c = he4->DrawCopy("E3 SAME");
   he4c->SetFillColor(kRed) ;
   he4c->GetXaxis()->SetRange(40,48);
   ce4->cd(2);
}