[ROOT] Re: your mail

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Feb 24 2001 - 21:52:04 MET


Hi Claire,
It is not clear what you want to shade exactly.
Here is an example from which you can get some inspiration.

Rene Brun


{
   gROOT->Reset();
   Int_t nbins = 100;
   TH1F *h1 = new TH1F("h1","h1",nbins,-3,3);
   h1->FillRandom("gaus",10000);
   h1->Draw();
   TH1F *h2 = (TH1F*)h1->Clone();
   Double_t mean = h1->GetMean();
   Double_t rms  = h1->GetRMS();
   for (Int_t i=1;i<=nbins;i++) {
      Double_t x = h1->GetXaxis()->GetBinCenter(i);
      if (x <mean-rms || x > mean+rms) h2->SetBinContent(i,0);
   }
   h2->SetFillColor(kRed);
   h2->SetFillStyle(3013);
   h2->Draw("same");
}

On Sat, 24 Feb 2001, Claire Gwenlan wrote:

> 
> Hi everybody,
> 
> Just wondering how to create a nice shaded band on a TGraph, for example a
> band stretching from -1 to +1 to represent 1 standard deviation on a
> graph.
> 
> Cheers,
> 
> Claire
> 
> __________________________________
>  Claire Gwenlan
>  Department of Physics & Astronomy
>  University College London
>  Gower Street
>  LONDON
>  WC1E 6BT
> 
>  Tel: 020 7679 3454
> _________________________________
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:37 MET