RE: Error bar not displayed if bin content above histogram maximum

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Tue, 7 Apr 2009 16:55:14 +0200


Hi Markus,

If the error bar is long enough you will not be able to tell whether the point is above the maximum or bellow the minimum. You will only see a vertical line crossing the pad. To show that there is actually some contain in that bin you can always superimpose an extra representation like a line going through the points (in addition to the error bars) that way there will be no ambiguity.

Cheers, Olivier

-----Original Message-----
From: cristinziani_at_gmail.com [mailto:cristinziani_at_gmail.com] On Behalf Of Markus Cristinziani Sent: Tuesday, April 07, 2009 4:45 PM
To: Olivier Couet
Cc: roottalk_at_root.cern.ch
Subject: Re: [ROOT] Error bar not displayed if bin content above histogram maximum

Hi Olivier,

 I agree, that the length of the piece of error bar would not be helpful. On the other hand one could at least tell that there *is* a content or even whether the bin content is higher than the maximum or lower than the minimum. In my specific application I am using TH1::Divide and displaying the ratio with fixed boundaries. I don't have a nice solution at the moment either.

cheers,
 Markus

On Tue, Apr 7, 2009 at 4:35 PM, Olivier Couet <Olivier.Couet_at_cern.ch> wrote:
> Hi,
>
> In your example the bin content is outside of the range and therefore is
> not displayed.
> I think it would be really confusing to see a line not attached to any
> data points.
> You would not know where it is coming from.
> A piece of error bar without the data point visible has no real meaning.
> That's why it was done that way.
>
> Cheers,
>
> Olivier
>
> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
> On Behalf Of Markus Cristinziani
> Sent: Tuesday, April 07, 2009 4:28 PM
> To: roottalk_at_root.cern.ch
> Subject: [ROOT] Error bar not displayed if bin content above histogram
> maximum
>
> Hello,
>
>  I have a TH1D histogram with errors and I would like to SetMaximum
> to a value, lower than a certain bin content. Draw will then draw
> nothing, although one might prefer to draw the rest of the error bar.
> I wonder whether this is intentional (i.e. there are good examples
> where you don't want that), or the behavior of Draw could be modified.
> Thanks.
>
> Markus
>
> TH1 *h1= new TH1D("h1","h1",1,0.,1.);
> h1->SetBinContent(1,5.);
> h1->SetBinError(1,3.);
> h1->Draw(); // bin content and error displayed correctly
>
> h1->SetMaximum(4);
> h1->Draw(); // could bin error be displayed ?
>
> --
> Markus Cristinziani
> Physikalisches Institut, Uni Bonn
> tel: +49(0)228-735762
> http://mc-eng.physik.uni-bonn.de/
>

-- 
Markus Cristinziani
Physikalisches Institut, Uni Bonn
tel: +49(0)228-735762
http://mc-eng.physik.uni-bonn.de/
Received on Tue Apr 07 2009 - 16:55:19 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 08 2009 - 17:50:02 CEST