TGaxis::SetMaxDigits incorrectly operates on both X and Y axes

From: Kevin Stenson <kevin.stenson_at_Colorado.EDU>
Date: Fri, 21 Jan 2011 19:05:18 -0700

It seems that per this thread from 2004
http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk04/1379.html the TGaxis::SetMaxDigits function was only going to operate on the y axis for 1D histograms. This is also confirmed by the documentation for TGaxis::SetMaxDigits which states:
Static function to set fgMaxDigits for axis with the bin content   (y axis for 1-d histogram, z axis for 2-d histogram)

However, setting this function still seems to control both the x and y axes of a histogram. This is true in 5.22, 5.27, and 5.28. This can be seen with the following example:
TH1F* testhist = new TH1F("testhist", "testhist", 100, 1000.0, 1400.0); testhist->SetMaximum(1500);
TGaxis::SetMaxDigits(4);
testhist->Draw();
TGaxis::SetMaxDigits(3);
testhist->Draw();

The first draw shows the x and y axes without exponent scaling. The second draw shows both the x and y axes with exponent scaling. Can anyone tell me a way to get the x axis from the first Draw and the y axis from the second Draw? (Other than hacking up the postscript file).

Thanks for any help,

Kevin

-- 
Kevin Stenson,              Phone: 303-492-1106   FAX: 303-492-5119
Assistant Professor,        Email: kevin.stenson_at_colorado.edu
Department of Physics,      Web: http://www-hep.colorado.edu/~stenson/
University of Colorado      Office: Duane F-317
UCB 390, Boulder, CO 80309-0390

Received on Sat Jan 22 2011 - 03:05:25 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 24 2011 - 17:50:01 CET