Re: [ROOT] Axis label precision, exponents, scientific notation

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Apr 26 2004 - 10:29:32 MEST


Hi Mike,

Thanks for your suggestions.
In the CVS version:
 -the algorithm with fgMaxDigits is only applied to the y axis for 1-d
histogram     and the z axis for 2-d histograms.
 -When an exponent is drawn with 10^N, N is always a multiple of 3

Rene Brun

Mike Kordosky wrote:
> 
> 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