[ROOT] Axis label precision, exponents, scientific notation

From: Mike Kordosky (kordosky@mail.hep.utexas.edu)
Date: Sun Apr 25 2004 - 00:16:35 MEST


Hi,

I'm trying to improve my logon file so as to decrease the amount of time
spent polishing figures.  One continual problem is the overlap between
numbers on the ordinate and the title.  I know that one can set pad
margins, title size, label size, center the title, etc.  Usually some
combination of the above can resolve any specific problem.  However, it 
isn't general.  As a general solution I'd like to do the following:

(1) Restrict the ordinate to no more than N digits:

I see that TGaxis has a static member function which does this.  Super.
However, one might want to do something different on the abscissa since it
usually represents some observable for which there are typical or natural
units. The ordinate, on the other hand, is often arbitrary. Additionally,
the problem of labels running into titles doesn't exist for the abscissa. 
So, it would be nice to be able to specify the number of digits on the 
ordinate and abscissa independently.

(2) Force labels into a common precision when there is an exponent:

If I do:

TGaxis::SetMaxDigits(2)

and then end up drawing a figure with an ordinate range in the thousands,
I see a labeling like:

"0  5  10  20 ... x10^{2}"

This looks unconventional. I'd much rather have something like: 

"0.0  0.5  1.0  2.0 ... x10^{3}"

Am I missing a workaround that will let me force this sort of labeling in 
the general case?


If there are no existing workarounds for my problem, would it be possible
to implement:
 
a) TGaxis::SetMaxDigits(int n, Option_t* axis ="XYZ")
b) Global axis label formatting instructions along the lines of printf?


I use ROOT 4.00/03 built w/ gcc 3.2 on a linux pc.

regards,

mike kordosky

-- 
Graduate Research Assistant  // High Energy Physics Lab
kordosky@hep.utexas.edu     // University of Texas at Austin
kordosky@fnal.gov	   //
ph: (512) 471-8426 (RLM Lab, Office)
    (512) 475-8673 (ENS Lab)



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET