RE: Problem with error bands on one/several histos

From: Michele Selvaggi <Michele.Selvaggi_at_cern.ch>
Date: Wed, 23 Nov 2011 15:48:41 +0000


Thanks, works perfectly now



From: Olivier Couet
Sent: 23 November 2011 16:25
To: Michele Selvaggi
Cc: roottalk (Mailing list discussing all aspects of the ROOT system.) Subject: Re: [ROOT] Problem with error bands on one/several histos

{

TH1F* R0      =  new TH1F("R0","R0",10,0.5,10.5);
TH1F* R1      =  new TH1F("R1","R1",10,0.5,10.5);



for(int k=1;k<11;k++){
 R0 -> Fill (k,100);
 R1 -> Fill (k,10);
}

TCanvas c;
c.cd();

R0->SetMinimum(0);
R0->SetMaximum(200);

R0->SetFillColor(kGray+1);
R0->Draw("e3");

TH1F* CR0=R0->DrawCopy("same hist CL");

CR0->SetMarkerSize(0);
CR0->SetLineColor(kBlack);
CR0->SetLineWidth(2);
CR0->SetFillColor(0);


R1->SetFillColor(kRed-7);

R1->SetFillStyle(3002);
R1->Draw("same e3");

TH1F* CR1=R1->DrawCopy("same hist CL");

CR1->SetMarkerSize(0);
CR1->SetLineColor(kRed);
CR1->SetLineWidth(2);
CR1->SetFillColor(0);

}

On Nov 23, 2011, at 4:10 PM, Olivier Couet wrote:

use E3 instead of E4.
See the explanation here:

http://root.cern.ch/root/html/THistPainter.html#HP09

On Nov 23, 2011, at 4:05 PM, Michele Selvaggi wrote:

TH1F* R0      =  new TH1F("R0","R0",10,0.5,10.5);
TH1F* R1      =  new TH1F("R1","R1",10,0.5,10.5);

for(int k=1;k<11;k++){
 R0 -> Fill (k,100);
 R1 -> Fill (k,10);
  }

TCanvas c;
c.cd();

R0->SetMinimum(0);
R0->SetMaximum(200);

R0->SetFillColor(kGray+1);
R0->DrawCopy("e4");

R0->SetMarkerSize(0);
R0->SetLineColor(kBlack);
R0->SetLineWidth(2);
R0->Draw("same hist CL");

R1->SetFillColor(kRed-7);

R1->SetFillStyle(3002);
R1->DrawCopy("same e4");
R1->SetMarkerSize(0);
R1->SetLineColor(kRed);
R1->SetLineWidth(2);
R1->Draw("same hist CL");
Received on Wed Nov 23 2011 - 16:48:49 CET

This archive was generated by hypermail 2.2.0 : Thu Nov 24 2011 - 05:50:01 CET