Re: get maximum & minimum x from TGraph

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 24 Jan 2007 22:56:06 +0100


You can use the functions TMath::MinElement or TMath::LocMin, eg

   TGraph *g;
   double xmin = TMath::MinElement(g->GetN(),g->GetX());

Rene Brun

Roger Mason wrote:
> Hi Oliver,
>
> "Olivier Couet" <Olivier.Couet_at_cern.ch> writes:
>
>
>> You can do :
>>
>> graph->GetHistogram()->GetMinimum();
>>
>>
>
> Thanks but that returns the minimim in y, whereas I want the minimum x
> value. I caould not find anything on getting max and min for graphs.
>
> Best wishes,
> Roger
>
Received on Wed Jan 24 2007 - 22:56:08 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 25 2007 - 17:50:01 CET