Re: [ROOT] TH1F: drawing option 'histe2' and TLegendEntry: Drawing option 'lf'

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jul 15 2003 - 10:19:29 MEST


Hi Gero,

Gero Flucke wrote:
> 
> Hi ROOTers,
> 
> 1)
> I tried to plot a 1D-histogram with an error band (option 'e2') AND with
> the line at the mean value. I tried
> 
> hist->Draw("histe2")
> 
> but the result is unsatisfactory, cf. script below,
> I can draw a white histogram with the lower error bounds on top of that,
> but that is quite annoying... :-(

You should not use the option "hist" to get the error band. If you give this
option, you will get the normal error band AND also teh normal fill area of teh
histo. Just do:
  hist->Draw(" e2");

> 
> 2)
> If I add a legend entry with option "lf" to a TLegend the resulting
> size of the fill area drawn in the legend box does not correspond to the
> line but depends on the legend box proportions.

I have fixed this problem in the CVS version. Thanks for reporting this.

Rene Brun

> 
> {
>   TH1* hist = new TH1F("hist", "hist", 5, 1, 10);
>   hist->SetBinContent(2, 5.);
>   hist->SetBinError(2, 1.5);
>   hist->SetBinContent(3, 7.);
>   hist->SetBinError(3, 1.);
>   hist->SetBinContent(4, 6.8.);
>   hist->SetBinError(4, .5);
> 
>   hist->SetFillColor(kYellow);
>   hist->Draw("histe2");
>   TLegend * l = new TLegend(0.5, 0.9, .99,.99, "header");
>   l->AddEntry(hist, "my hist", "lf");
>   l->Draw();
> }
> 
> If you move around the lower left edge of the TLegend-box you see this
> dependence.
> 
> Cheers
> 
>         Gero
> 
> PS: ROOT 3.04_02 on linux
> 
> -----------------------------------------------------------------------
> Gero Flucke
> 1a / 603
> DESY
> Notkestr. 85
> 22607 Hamburg
> +49-(0)40-8998-2454



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET