Re: [ROOT] TGraph - Update

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jun 07 2001 - 12:05:24 MEST


Hi Reiner,

The behaviour in 2.25 was wrong.
You should remove the canvas->Update line if you want to see all the points.
canvas->Update will force the computation of the pad limits. Modifying the graph
points later will not force a recomputation of the pad limits.

Rene Brun

Reiner Rohlfs wrote:
> 
> Hi ROOTteam
> 
> I want to update a point in TGraph. In version 3.00/06 the range of the axis
> are not updated.
> This worked fine in version 2.25/03
> 
> Following macro shows different results in these versions. I like the result of
> version 2.25
> 
> Thanks Reiner.
> 
> {
>    gROOT->Reset();
> 
>    TCanvas * canvas = new TCanvas("a", "b", 20, 20, 300, 400);
>    Double_t x[3] = {10, 20, 30};
>    Double_t y[3] = {5,  10, 8};
> 
>    TGraph * graph = new TGraph(3, x, y);
>    graph->Draw("AL");
> 
>    canvas->Update();
> 
>    graph->SetPoint(2, 40, 18);
>    canvas->Modified();
> 
> }



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