Service class for the graphical representation of axis.
Instances of this class are generated by the histogram classes and TGraph.
The picture below has been generated by the following macro.
{
gROOT.Reset();
c1 = new TCanvas("c1","Examples of Gaxis",10,10,700,500);
c1->Range(-10,-1,10,1);
TGaxis *axis1 = new TGaxis(-4.5,-0.2,5.5,-0.2,-6,8,510,"");
axis1->SetName("axis1");
axis1->Draw();
TGaxis *axis2 = new TGaxis(-4.5,0.2,5.5,0.2,0.001,10000,510,"G");
axis2->SetName("axis2");
axis2->Draw();
TGaxis *axis3 = new TGaxis(-9,-0.8,-9,0.8,-8,8,50510,"");
axis3->SetName("axis3");
axis3->Draw();
TGaxis *axis4 = new TGaxis(-7,-0.8,-7,0.8,1,10000,50510,"G");
axis4->SetName("axis4");
axis4->Draw();
TGaxis *axis5 = new TGaxis(-4.5,-0.6,5.5,-0.6,1.2,1.32,80506,"-+");
axis5->SetName("axis5");
axis5->SetLabelSize(0.03);
axis5->SetTextFont(72);
axis5->SetLabelOffset(0.025);
axis5->Draw();
TGaxis *axis6 = new TGaxis(-4.5,0.6,5.5,0.6,100,900,50510,"-");
axis6->SetName("axis6");
axis6->Draw();
TGaxis *axis7 = new TGaxis(8,-0.8,8,0.8,0,9000,50510,"+L");
axis7->SetName("axis7");
axis7->SetLabelOffset(0.01);
axis7->Draw();
//one can make axis going top->bottom. However because of a long standing
//problem, the two x values should not be equal
TGaxis *axis8 = new TGaxis(6.5,0.8,6.499,-0.8,0,90,50510,"-");
axis8->SetName("axis8");
axis8->Draw();
}
/*
*/
See the second TGaxis constructor for examples of TGaxis
with a mapping function.

*-*-*-*-*-*-*-*-*-*-*-*Control function to draw an axis*-*-*-*-*-*-*-*-*-*-*
*-* ================================
============> Original authors (O.Couet C.E.Vandoni N.Cremel-Somon)
largely modified and converted to C++ class by Rene Brun
_Input parameters:
xmin : X origin coordinate in WC space.
xmax : X end axis coordinate in WC space.
ymin : Y origin coordinate in WC space.
ymax : Y end axis coordinate in WC space.
wmin : Lowest value for the tick mark
labels written on the axis.
wmax : Highest value for the tick mark labels
written on the axis.
ndiv : Number of divisions.
ndiv=N1 + 100*N2 + 10000*N3
N1=number of 1st divisions.
N2=number of 2nd divisions.
N3=number of 3rd divisions.
e.g.:
nndi=0 --> no tick marks.
nndi=2 --> 2 divisions, one tick mark in the middle
of the axis.
chopt : Options (see below).
chopt='G': loGarithmic scale, default is linear.
chopt='B': Blank axis. Useful to superpose axis.
Orientation of tick marks on axis.
----------------------------------
Tick marks are normally drawn on the positive side of the axis,
however, if X0=X1, then negative.
chopt='+': tick marks are drawn on Positive side. (default)
chopt='-': tick mark are drawn on the negative side.
i.e: '+-' --> tick marks are drawn on both sides of the axis.
chopt='U': Unlabeled axis, default is labeled.
Size of tick marks
------------------
By default, tick marks have a length equal to 3 per cent of the
axis length.
When the option "S" is specified, the length of the tick marks
is equal to fTickSize*axis_length, where fTickSize may be set
via TGaxis::SetTickSize.
Position of labels on axis.
---------------------------
Labels are normally drawn on side opposite to tick marks.
However:
chopt='=': on Equal side
Orientation of labels on axis.
------------------------------
Labels are normally drawn parallel to the axis.
However if X0=X1, then Orthogonal
if Y0=Y1, then Parallel
Position of labels on tick marks.
---------------------------------
Labels are centered on tick marks.
However , if X0=X1, then they are right adjusted.
chopt='R': labels are Right adjusted on tick mark.
(default is centered)
chopt='L': labels are Left adjusted on tick mark.
chopt='C': labels are Centered on tick mark.
chopt='M': In the Middle of the divisions.
Format of labels.
-----------------
Blank characters are stripped, and then the
label is correctly aligned. the dot, if last
character of the string, is also stripped.
In the following, we have some parameters, like
tick marks length and characters height (in percentage
of the length of the axis (WC))
The default values are as follows:
Primary tick marks: 3.0 %
Secondary tick marks: 1.5 %
Third order tick marks: .75 %
Characters height for labels: 4%
Labels offset: 1.0 %
Optional grid.
--------------
chopt='W': cross-Wire
Axis bining optimization.
-------------------------
By default the axis bining is optimized .
chopt='N': No bining optimization
chopt='I': Integer labelling
Maximum Number of Digits for the axis labels
--------------------------------------------
See the static function TGaxis::SetMaxDigits
Time representation.
--------------------
Axis labels may be considered as times, plotted in
a defined time format. The format id set with SetTimeFormat().
chopt='t': Plot times with a defined format instead of values

static function to set fgMaxDigitsfgMaxDigits is the maximum number of digits permitted for the axis
labels above which the notation with 10^N is used.
For example, to accept 6 digits number like 900000 on an axis
call TGaxis::SetMaxDigits(6). The default value is 5.
fgMaxDigits must be greater than 0.

Set the NoExponent flag
By default, an exponent of the form 10^N is used when the label values
are either all very small or very large.
One can disable the exponent by calling axis.SetNoExponent(kTRUE).

*-*-*-*-*-*-*-*-*-*-*Change the format used for time plotting *-*-*-*-*-*-*-*
*-* ========================================
The format string for date and time use the same options as the one used
in the standard strftime C function, i.e. :
for date :
%a abbreviated weekday name
%b abbreviated month name
%d day of the month (01-31)
%m month (01-12)
%y year without century
for time :
%H hour (24-hour clock)
%I hour (12-hour clock)
%p local equivalent of AM or PM
%M minute (00-59)
%S seconds (00-61)
%% %

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.