[ROOT] axis help

From: Johnathan Wang (Johnathan.Wang@morganstanley.com)
Date: Tue Oct 07 2003 - 17:07:45 MEST


I have a piece of code that plots an ntuple (the code is below), but I
can't figure out how to adjust the scale of the axes. How does one get
the axes of a ntuple and change the scale of each of them?

Thanks,
john

{
//   example of macro to read data from an ascii file and
//   create a root file with an histogram and an ntuple.

//{  
  gROOT->Reset();
  TCanvas *canvas = new TCanvas("canvas","A",200,10,700,780);

  TNtuple *ntuple = new TNtuple("ntuple", "data from ascii file",
"x:y:z:v");  
  ntuple->ReadFile ("test");
  
  char var[64] = "v";
  char tmp[64] = "", tmp2[64] = "";
  int min = 4;


  for (int i = min; i < 9; ++i) {
    tmp[0] = '\0'; 
    tmp2[0] = '\0';
    ntuple->SetMarkerColor(i);
    sprintf (tmp, "%s%s%d", var, " >= ", i);
    TCut c1 (tmp);
    sprintf (tmp2, "%s%s%d", var, " < ", i+1);
    TCut c2 (tmp2);
    if (i == min) 
      ntuple->Draw ("x:y:z", c1 && c2);
    else
      ntuple->Draw ("x:y:z", c1 && c2, "same");
  }
}



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET