void graph2D_mod1() { TCanvas *c = new TCanvas("c","Graph2D example",0,0,700,600); Double_t x, y, z, P = 15.; Int_t np = 100; TGraph2D *graph = new TGraph2D(); TRandom *r = new TRandom(); //Int_t const m[10], n[10],p[10]; //Int_t *m; for (Int_t N=0; NRndm(N))-P; y = 2*P*(r->Rndm(N))-P; z=0; // setting z=0 causes problem with 3d graphics. // z=1.0; // this is ok, but is not ideal suitable for 2D image segmentation graph->SetPoint(N,x,y,z); } // gStyle->SetPalette(1); graph->Draw("TRIW"); c->Update(); }