Re: [ROOT] Setting horizontal error bars separately for different histos

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Dec 14 2002 - 19:30:32 MET


Hi Claire,

An example:

void transe() {
   gStyle->SetErrorX(0);
   TH1F *h1 = new TH1F("h1","test1",30,-2,2);
   TF1 f1("f1","gaus",-2,2);
   f1->SetParameters(1,-0.5,1);
   h1->FillRandom("f1",10000);
   TH1F *h2 = new TH1F("h2","test2",30,-2,2);
   f1->SetParameters(1,0.5,0.3);
   h2->FillRandom("f1",3200);
   h1->SetLineColor(kRed);
   h1->SetMarkerStyle(20);
   h1->SetMarkerColor(kRed);
   h1->Draw("e1");
   TExec *setex2 = new TExec("setex2","gStyle->SetErrorX(0.5)");
   setex2->Draw();
   h2->SetMarkerStyle(21);
   h2->SetMarkerSize(0.7);
   h2->Draw("e1 same");
   TExec *setex1 = new TExec("setex1","gStyle->SetErrorX(0)");
   setex1->Draw();
}   


Rene Brun

On Sat, 14 Dec 2002, Claire Gwenlan wrote:

> Hi,
> 
> Is it possible to make different histograms on the same canvas have 
> different lengths of error bar? For example, in a plot with two 
> histograms, I would like to have no 
> horizontal error bar for 1 histogram, but the defualt 
> gStyle->SetErrorX(0.5); for the other, on the same plot.
> 
> 
> Thank you very much,
> 
> Claire
> 
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:23 MET