Labels on log scale, again

From: lijowski@cosray2.wustl.edu
Date: Thu Apr 29 1999 - 18:10:11 MEST


   Hello,

  Besides having a problem with labels on major tickmarks on X axis
  in the following macro, I cannot force these labels any closer to the 
  X axis with gStyle -> SetLabelOffset(0.00001, "X") than some default 
  value, which is  about 0.1 of pad height.

  Michal Lijowski

{
   gROOT -> Reset();
   TCanvas *cc1 = new TCanvas("cc1", "My Canvas", 600, 800);
   gStyle -> SetTitleX(0.22);
   gStyle -> SetTitleY(0.97);
   gStyle -> SetLabelOffset(0.0001 "X");

   gPad -> SetBottomMargin(0.15);
   gPad -> SetLeftMargin(0.15);
   gPad -> SetTicks();
   gPad -> SetLogx();
   gPad -> SetLogy();

// define plot ranges with histogram class

  Float_t  xxmin =   50.0;
  Float_t  xxmax = 1000.0;
  Float_t  yymin = 1.0E-9;
  Float_t  yymax = 2.0E-6;

  h2r = new TH2F("h2r", "Axis test", 2, xxmin, xxmax, 2, yymin, yymax);
  printf(" NDiv %d\n", h2r -> GetXaxis() -> GetNdivisions());
  h2r -> GetXaxis() -> SetNdivisions(-101);
  printf(" NDiv %d\n", h2r -> GetXaxis() -> GetNdivisions());
  h2r -> Draw();
  printf(" Label offset  %9.3E\n", gStyle -> GetLabelOffset("X"));
  cc1 -> Update();
}
 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:32 MET