How to use RangeAxis()

From: Yongzhao Zhou (Yongzhao.Zhou@lnf.infn.it)
Date: Thu Feb 17 2000 - 16:23:11 MET


Hello,
My program has three histograms on three pads on a canvas using ROOT 
v.2.20. I'd like to have a zoom together with them when one of the pads
has a zoom after Left button of the mouse is clicked on one of the line
end points, moved and released. So I tried function RangeAxis in order to
pick up the data of Xmin, Xmax, Ymin, Ymax and put it to others pads. My
codes to try are simple as:
   gROOT->Reset();
   c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
   pad1 = new TPad("pad1","Window N1",0.02,0.02,0.98,0.96,18);
   pad1->Draw();
   pad1->cd();
 
   const Int_t n = 20;
   Float_t x[n], y[n];
   for (Int_t i=0;i<n;i++) {
     x[i] = i*0.1;
     y[i] = 10*sin(x[i]+0.2);
   }

   gr = new TGraph(n,x,y);
   gr->Draw("ACP");

   gPad->RangeAxis(0,0.1,0.3,0.9); //or  gPad->RangeAxis(1,0.44,1.5,12);
   gPad->Modified(kTRUE);          //or  gPad->Modified();
   
   c1->Update();

The codes seems to be ok but the histogram was same as without function
RangeAxis.
Would you please tell me what is happened here.
Thanks so lot.
Best,
ZYZ 
   


------
Yongzhao Zhou, KLOE, LNF, INFN, Italy
Tel:39-06-94032696 Fax:39-06-94032427



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET