[ROOT] One Extra Point

From: Ivan So (so@bnl.gov)
Date: Sat Nov 06 2004 - 01:31:42 MET


Hi root folks,

Would someone tell me why I always get one more point at (0, 0) in the 
following code:

// We get one more point at (0, 0). Why?

void zero0 () {

  gROOT->Reset();

  TCanvas *c1= new TCanvas("c1","Plots",400,10,900,780);
  TGraph  *gr = new TGraph(60);

  c1->DrawFrame(-1.2, -1.2, 1.2, 1.2, "10 Points");

  gr->SetMarkerColor(kRed);

  Float_t px, py;
  const Float_t s = 10.;

  for (int i = 0; i < 10; i++) {
    px = TMath::Sin(i / s);
    py = TMath::Cos(i / s);
    gr->SetPoint(i,px,py);

  }
  gr->Draw("*");
  c1->Modified();
  c1->Update();
}

The root version is Version   4.01/02.

Thanks.

Ivan
so@bnl.gov



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET