Yes you are right, The documentation is not right. SetMaxDigits is a
global setting which applies on all the axis.
I will update de doc according to the real behavior.
What you are looking for is on the to-list about TGAxis:
https://savannah.cern.ch/task/index.php?18777
-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
On Behalf Of Kevin Stenson
Sent: Saturday, January 22, 2011 3:05 AM
To: roottalk_at_lxroot01.cern.ch
Subject: [ROOT] TGaxis::SetMaxDigits incorrectly operates on both X and
Y axes
It seems that per this thread from 2004
http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk04/1
379.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-0390Received on Mon Jan 24 2011 - 14:16:40 CET
This archive was generated by hypermail 2.2.0 : Mon Jan 24 2011 - 17:50:01 CET