Re: [ROOT] tick marks and labels

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Wed Mar 26 2003 - 09:48:28 MET


Hi,

 On log axis you can only change the number of primary divisions. This 
number is used a maximum, the number of division being drawn is then 
optimize to get a "nice" labeling. For instance in the following example 
I ask four divisions but only three are drawn (and, of course, four 
labels).

{
   gROOT.Reset();
   c1 = new TCanvas("c1","Examples of Gaxis",10,10,700,500);
   c1->Range(-10,-1,10,1);
   TGaxis *axis2 = new TGaxis(-4.5,0.2,5.5,0.2,1E-10,1,4,"G");       
   axis2->SetName("axis2");
   axis2->Draw();
}
 
For the time being the control on the log divisions is not as complete as 
the one you have on linear divisions. The TGaxis class (the one which 
draws the axis) need to be completely revisited (and even rewrite) to 
allow further improvements.

 Cheers,      Olivier



On Tue, 25 Mar 2003, Sandhia Bansal wrote:

> Hello,
> 
> We are using ROOT 3.02/07.
> 
> I am trying to make a 2-D plot with xaxis in log scale and yaxis in linear.
> 
> I am using NDivision=205 to produce the correct tick marks on the 
> xaxis.  However the I cannot get labels to
> print out in the format that I want.  I would like these to be:
> 	10**-10    10**-8    10**-6    10**-4    10**-2    10**0
> where 10**-10 and 10**-2 are at the edges.
> 
> For the xaxis I cannot get either of the tick marks or labels printed 
> correctly.
> The xaxis is log-scaled and should have 4 divisions with each division 
> having 9 sub-divisions.  So, I am trying
> to use NDivision=904 - however this does not produce what I expect.
> The y-axis labels need to be
> 	10**0    10**1    10**2    10**3    10**4
> where 10**0 and 10**4 are at the edges.
> 
> Thank you
> Sandhia
> 
> 

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet@cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7677155



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