ROOT  6.06/09
Reference Guide
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TGaxis Class Reference

The axis painter class.

Instances of this class are generated by the histograms and graphs painting classes when TAxis are drawn. TGaxis is the "painter class"of TAxis. Therefore it is mainly used via TAxis, even if is some occasion it can be used directly to draw an axis which is not part of a graph or an instance. For instance to draw an extra scale on a plot.

Basic definition

A TGaxis is defined the following way:

Where:

The example below generates various kind of axis.

{
TCanvas *c1 = new TCanvas("c1","Examples of TGaxis",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();
return c1;
}
TGaxis_001.png

Definition with a function

Instead of the wmin,wmax arguments of the normal definition, the name of a TF1 function can be specified. This function will be used to map the user coordinates to the axis values and ticks.

A TGaxis is defined the following way:

const char *func, Int_t ndiv, Option_t *chopt,
Double_t gridlength)

Where:

Examples:

{
TCanvas *c2 = new TCanvas("c2","c2",10,10,700,500);
TH2F *h2 = new TH2F("h","Axes",100,0,10,100,-2,2);
h2->Draw();
TF1 *f1=new TF1("f1","-x",-10,10);
TGaxis *A1 = new TGaxis(0,2,10,2,"f1",510,"-");
A1->SetTitle("axis with decreasing values");
A1->Draw();
TF1 *f2=new TF1("f2","exp(x)",0,2);
TGaxis *A2 = new TGaxis(1,1,9,1,"f2");
A2->SetTitle("exponential axis");
A2->SetLabelSize(0.03);
A2->SetTitleSize(0.03);
A2->SetTitleOffset(1.2);
A2->Draw();
TF1 *f3=new TF1("f3","log10(x)",1,1000);
TGaxis *A3 = new TGaxis(2,-2,2,0,"f3",505,"G");
A3->SetTitle("logarithmic axis");
A3->SetLabelSize(0.03);
A3->SetTitleSize(0.03);
A3->SetTitleOffset(1.2);
A3->Draw();
return c2;
}
TGaxis_002.png

Logarithmic axis

By default axis are linear. To define a TGaxis as logarithmic, it is enough to create it with the option "G".

When plotting an histogram or a graph the logarithmic scale can be set using:

When the SetMoreLogLabels() method is called more labels are drawn when in logarithmic scale and there is a small number of decades (less than 3).

Blank axis

To draw only the axis tick marks without the axis body, it is enough to specify the option "B". It useful to superpose axis.

Tick marks' orientation

By default tick marks are drawn on the positive side of the axis, except for vertical axis for which the default is negative. The chop parameter allows to control the tick marks orientation:

Tick marks' size

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.

When plotting an histogram h the tick marks size can be changed using:

A good way to remove tick marks on an axis is to set the tick length to 0: h->GetXaxis()->SetTickLength(0.);

Labels' positionning

Labels are normally drawn on side opposite to tick marks. However the option "=" allows to draw them on the same side.

Labels' orientation

By default axis labels are drawn parallel to the axis. However if the axis is vertical then are drawn perpendicular to the axis.

Labels' position on tick marks

By default axis labels are centered on tick marks. However, for vertical axis, they are right adjusted. The chop parameter allows to control the labels' position on tick marks:

Labels' format

Blank characters are stripped, and then the label is correctly aligned. the dot, if last character of the string, is also stripped, unless the option "." (a dot, or period) is specified. if SetDecimals(kTRUE) has been called all labels have the same number of decimals after the "." The same is true if gStyle->SetStripDecimals(kFALSE) has been called.

In the following, we have some parameters, like tick marks length and characters height (in percentage of the length of the axis (user's coordinates)) The default values are as follows:

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).

TGaxis::SetExponentOffset(Float_t xoff, Float_t yoff, Option_t *axis) is static function to set X and Y offset of the axis 10^n notation. It is in % of the pad size. It can be negative. axis specifies which axis ("x" or/and "y"), default is "x" if axis = "xz" set the two axes

Alphanumeric labels

Axis labels can be any alphanumeric character strings. Such axis can be produced only with histograms because the labels'definition is stored in TAxis. The following example demonstrates how to create such labels.

// 2-D histograms with alphanumeric labels
// author; Rene Brun
TCanvas *hlabels2()
{
const Int_t nx = 12;
const Int_t ny = 20;
const char *month[nx] = {"January","February","March","April","May",
"June","July","August","September","October","November",
"December"};
const char *people[ny] = {"Jean","Pierre","Marie","Odile","Sebastien",
"Fons","Rene","Nicolas","Xavier","Greg","Bjarne","Anton",
"Otto","Eddy","Peter","Pasha","Philippe","Suzanne","Jeff",
"Valery"};
TCanvas *c1 = new TCanvas("c1","demo bin labels",10,10,600,600);
c1->SetGrid();
c1->SetLeftMargin(0.15);
c1->SetBottomMargin(0.15);
TH2F *h = new TH2F("h","test",3,0,3,2,0,2);
h->SetStats(0);
for (Int_t i=0;i<15000;i++) {
Int_t rx = gRandom->Rndm()*nx;
Int_t ry = gRandom->Rndm()*ny;
h->Fill(people[ry],month[rx],1);
}
h->LabelsDeflate("X");
h->LabelsDeflate("Y");
h->LabelsOption("v");
h->Draw("text");
TPaveText *pt = new TPaveText(0.6,0.85,0.98,0.98,"brNDC");
pt->SetFillColor(18);
pt->SetTextAlign(12);
pt->AddText("Use the axis Context Menu LabelsOption");
pt->AddText(" \"a\" to sort by alphabetic order");
pt->AddText(" \">\" to sort by decreasing values");
pt->AddText(" \"<\" to sort by increasing values");
pt->Draw();
return c1;
}
TGaxis_003.png

Because the alphanumeric labels are usually longer that the numeric labels, their size is by default equal to 0.66666 * the_numeric_labels_size.

Number of divisions optimisation

By default the number of divisions on axis is optimised to show a coherent labelling of the main tick marks. The number of division (ndiv) is a composite integer given by:

ndiv = N1 + 100*N2 + 10000*N3

by default the value of N1, N2 and N3 are maximum values. After optimisation the real number of divisions will be smaller or equal to these value. If one wants to bypass the optimisation, the option "N" should be given when the TGaxis is created. The option "I" also act on the number of division as it will force an integer labelling of the axis.

On an histogram pointer h the number of divisions can be set in different ways:.

The first parameter is the number of division. If it is negative of if the second parameter is kFALSE then the number of divisions is not optimised. And other signature is also allowed:

h->GetXaxis()->SetNdivisions(10, 5, 0, kTRUE);

Maximum Number of Digits for the axis labels

The static function TGaxis::SetMaxDigits sets 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.

Optional grid

The option "W" allows to draw a grid on the primary tick marks. In case of a log axis, the grid is only drawn for the primary tick marks if the number of secondary and tertiary divisions is 0. SetGridLength() allows to define the length of the grid.

When plotting an histogram or a graph the grid can be set ON or OFF using:

Time axis

Axis labels may be considered as times, plotted in a defined time format. The format is set with SetTimeFormat(). The TGaxis minimum (wmin) and maximum (wmax) values are considered as two time values in seconds. The time axis will be spread around the time offset value (set with SetTimeOffset()). Actually it will go from TimeOffset+wminto TimeOffset+wmax

Usually time axis are created automatically via histograms, but one may also want to draw a time axis outside an "histogram context". This can be done thanks to the option "T" of TGaxis.

{
c1 = new TCanvas("c1","Examples of TGaxis",10,10,700,100);
c1->Range(-10,-1,10,1);
TGaxis *axis = new TGaxis(-8,0.,8,0.,-100000,150000,2405,"tS");
axis->SetLabelSize(0.3);
axis->SetTickSize(0.2);
TDatime da(2003,02,28,12,00,00);
axis->SetTimeOffset(da.Convert());
axis->SetTimeFormat("%d-%m-%Y");
axis->Draw();
return c1;
}
TGaxis_004.png

The following example compares what the system time function gmtime and localtime give with what gives TGaxis. It can be used as referenced test to check if the time option of TGaxis is working properly.

// This example compares what the system time function gmtime and localtime give
// with what gives TGaxis. It can be used as referenced test to check if TGaxis
// is working properly.
// The original code was developped by Philippe Gras (CEA Saclay. IRFU/SEDI)
//Author: Philippe Gras, Bertrand Bellenot, Olivier Couet
#if defined(G__WIN32) && defined(__CINT__) && !defined(__MAKECINT__)
{
// timeonaxis3.C has to be run in compiled mode on Windows.
// the following code does it.
gSystem->CompileMacro("timeonaxis3.C");
timeonaxis3();
}
#else
#include "TAxis.h"
#include "TGaxis.h"
#include "TCanvas.h"
#include "TString.h"
#include "TLine.h"
#include "TLatex.h"
#include <time.h>
#include <stdio.h>
TString stime(time_t* t, bool utc = false, bool display_time_zone = true) {
struct tm* tt;
if (utc) tt = gmtime(t);
else tt = localtime(t);
char buf[256];
if (display_time_zone) strftime(buf, sizeof(buf), "%H:%M:%S %Z", tt);
else strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tt);
return TString(buf);
}
TCanvas * timeonaxis3() {
double f = 1.8;
TCanvas* c = new TCanvas;
TLatex* tex1 = new TLatex;
tex1->SetNDC();
tex1->SetTextFont(102);
tex1->SetTextSize(0.07*f);
TLatex* tex3 = new TLatex;
tex3->SetNDC();
tex3->SetTextFont(102);
tex3->SetTextSize(0.07*f);
tex3->SetTextColor(kBlue+2);
TLatex* tex2 = new TLatex;
tex2->SetNDC();
tex2->SetTextFont(102);
tex2->SetTextSize(0.07*f);
time_t offset[] = {0, 0, 1325376000, 1341100800};
time_t t[] = {1331150400, 1336417200, 0, 36000};
c->Divide(2, 4, -1, -1);
l.DrawLine(0.5, 0, 0.5, 1.);
for(int i = 0; i < 4; ++i){
for(int gmt = 0; gmt < 2; ++gmt){
const char* opt = (gmt ? "gmt" : "local");
TVirtualPad* p = c->cd(2*i + gmt + 1);
p->SetFillStyle(4000);
TGaxis* ga = new TGaxis (.4, .25, 5., .25, t[i], t[i] + 1, 1, "t");
ga->SetTimeFormat("TGaxis label: #color[2]{%Y-%m-%d %H:%M:%S}");
ga->SetLabelFont(102);
ga->SetLabelColor(kBlue+2);
ga->SetTimeOffset(offset[i], opt);
ga->SetLabelOffset(0.04*f);
ga->SetLabelSize(0.07*f);
ga->SetLineColor(0);
ga->Draw();
// Get offset string of axis time format: there is not acccessor
// to time format in TGaxis.
// Assumes TAxis use the same format.
TAxis a(10, 0, 1600000000);
a.SetTimeOffset(offset[i], opt);
const char* offsettimeformat = a.GetTimeFormat();
char buf[256];
if (offset[i] < t[i]) {
sprintf(buf, "#splitline{%s, %s}{offset: %ld, option %s}",
stime(t+i).Data(), stime(t+i, true).Data(), offset[i], opt);
} else {
int h = t[i] / 3600;
int m = (t[i] - 3600 * h) / 60 ;
int s = (t[i] - h * 3600 - m * 60);
sprintf(buf, "#splitline{%d h %d m %d s}{offset: %s, option %s}",
h, m, s, stime(offset + i, gmt).Data(), opt);
}
tex1->DrawLatex(.01, .75, buf);
tex2->DrawLatex(.01, .50, offsettimeformat);
time_t t_ = t[i] + offset[i];
sprintf(buf, "Expecting: #color[2]{%s}", stime(&t_, gmt, false).Data());
tex3->DrawLatex(.01, .24, buf);
if(i > 0) l.DrawLine(0, 0.95, 1, 0.95);
}
}
return c;
}
#endif
TGaxis_005.png

The following macro illustrates the use, with histograms axis, of the time mode on the axis with different time intervals and time formats.

#include <time.h>
TCanvas *timeonaxis()
{
// This macro illustrates the use of the time mode on the axis
// with different time intervals and time formats. It's result can
// be seen begin_html <a href="gif/timeonaxis.gif">here</a> end_html
// Through all this script, the time is expressed in UTC. some
// information about this format (and others like GPS) may be found at
// begin_html <a href="http://tycho.usno.navy.mil/systime.html">http://tycho.usno.navy.mil/systime.html</a> end_html
// or
// begin_html <a href="http://www.topology.org/sci/time.html">http://www.topology.org/sci/time.html</a> end_html
//
// The start time is : almost NOW (the time at which the script is executed)
// actualy, the nearest preceding hour beginning.
// The time is in general expressed in UTC time with the C time() function
// This will obviously most of the time not be the time displayed on your watch
// since it is universal time. See the C time functions for converting this time
// into more useful structures.
//Author: Damir Buskulic
time_t script_time;
script_time = time(0);
script_time = 3600*(int)(script_time/3600);
// The time offset is the one that will be used by all graphs.
// If one changes it, it will be changed even on the graphs already defined
gStyle->SetTimeOffset(script_time);
TCanvas *ct = new TCanvas("ct","Time on axis",10,10,700,900);
ct->Divide(1,3);
ct->SetFillColor(28);
int i;
//======= Build a signal : noisy damped sine ======
// Time interval : 30 minutes
gStyle->SetTitleH(0.08);
float noise;
TH1F *ht = new TH1F("ht","Love at first sight",3000,0.,2000.);
for (i=1;i<3000;i++) {
noise = gRandom->Gaus(0,120);
if (i>700) {
noise += 1000*sin((i-700)*6.28/30)*exp((double)(700-i)/300);
}
ht->SetBinContent(i,noise);
}
ct->cd(1);
gPad->SetFillColor(41);
gPad->SetFrameFillColor(33);
ht->SetLineColor(2);
ht->GetXaxis()->SetLabelSize(0.05);
ht->Draw();
// Sets time on the X axis
// The time used is the one set as time offset added to the value
// of the axis. This is converted into day/month/year hour:min:sec and
// a reasonnable tick interval value is chosen.
//======= Build a simple graph beginning at a different time ======
// Time interval : 5 seconds
float x[100], t[100];
for (i=0;i<100;i++) {
x[i] = sin(i*4*3.1415926/50)*exp(-(double)i/20);
t[i] = 6000+(double)i/20;
}
TGraph *gt = new TGraph(100,t,x);
gt->SetTitle("Politics");
ct->cd(2);
gPad->SetFillColor(41);
gPad->SetFrameFillColor(33);
gt->SetFillColor(19);
gt->SetLineColor(5);
gt->SetLineWidth(2);
gt->Draw("AL");
gt->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
gPad->Modified();
//======= Build a second simple graph for a very long time interval ======
// Time interval : a few years
float x2[10], t2[10];
for (i=0;i<10;i++) {
x2[i] = gRandom->Gaus(500,100)*i;
t2[i] = i*365*86400;
}
TGraph *gt2 = new TGraph(10,t2,x2);
gt2->SetTitle("Number of monkeys on the moon");
ct->cd(3);
gPad->SetFillColor(41);
gPad->SetFrameFillColor(33);
gt2->SetFillColor(19);
gt2->SetMarkerColor(4);
gt2->SetMarkerStyle(29);
gt2->SetMarkerSize(1.3);
gt2->Draw("AP");
gt2->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
//
// One can choose a different time format than the one chosen by default
// The time format is the same as the one of the C strftime() function
// It's a string containing the following formats :
// 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
// %Y year with 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)
// %% %
// The other characters are output as is.
gt2->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00");
gPad->Modified();
return ct;
}
TGaxis_006.png

An other example showing how to define the time offset as 2003, January 1st using histograms axis.

TCanvas *timeonaxis2() {
// Define the time offset as 2003, January 1st
//Author: Olivier Couet
TCanvas *ct2 = new TCanvas("ct2","ct2",10,10,700,500);
TDatime T0(2003, 1, 1, 0, 0, 0);
int X0 = T0.Convert();
// Define the lowest histogram limit as 2002, September 23rd
TDatime T1(2002, 9, 23, 0, 0, 0);
int X1 = T1.Convert()-X0;
// Define the highest histogram limit as 2003, March 7th
TDatime T2(2003, 3, 7, 0, 0, 0);
int X2 = T2.Convert(1)-X0;
TH1F * h1 = new TH1F("h1","test",100,X1,X2);
for (Int_t i=0;i<30000;i++) {
Double_t noise = r.Gaus(0.5*(X1+X2),0.1*(X2-X1));
h1->Fill(noise);
}
h1->GetXaxis()->SetLabelSize(0.03);
h1->GetXaxis()->SetTimeFormat("%Y/%m/%d");
h1->Draw();
return ct2;
}
TGaxis_007.png

Definition at line 39 of file TGaxis.h.

Public Member Functions

 TGaxis ()
 
 TGaxis (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t wmin, Double_t wmax, Int_t ndiv=510, Option_t *chopt="", Double_t gridlength=0)
 TGaxis normal constructor. More...
 
 TGaxis (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, const char *funcname, Int_t ndiv=510, Option_t *chopt="", Double_t gridlength=0)
 Constructor with a TF1 to map axis values. More...
 
virtual ~TGaxis ()
 TGaxis default destructor. More...
 
virtual void AdjustBinSize (Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BinWidth)
 Internal method for axis labels optimisation. More...
 
virtual void CenterLabels (Bool_t center=kTRUE)
 If center = kTRUE axis labels are centered in the center of the bin. More...
 
virtual void CenterTitle (Bool_t center=kTRUE)
 If center = kTRUE axis title will be centered. The default is right adjusted. More...
 
virtual void DrawAxis (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t wmin, Double_t wmax, Int_t ndiv=510, Option_t *chopt="", Double_t gridlength=0)
 Draw this axis with new attributes. More...
 
Float_t GetGridLength () const
 
TF1GetFunction () const
 
Int_t GetLabelColor () const
 
Int_t GetLabelFont () const
 
Float_t GetLabelOffset () const
 
Float_t GetLabelSize () const
 
Float_t GetTitleOffset () const
 
Float_t GetTitleSize () const
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual const char * GetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
Int_t GetNdiv () const
 
Double_t GetWmin () const
 
Double_t GetWmax () const
 
Float_t GetTickSize () const
 
virtual void ImportAxisAttributes (TAxis *axis)
 Internal method to import TAxis attributes to this TGaxis. More...
 
void LabelsLimits (const char *label, Int_t &first, Int_t &last)
 Internal method to find first and last character of a label. More...
 
virtual void Paint (Option_t *chopt="")
 Draw this axis with its current attributes. More...
 
virtual void PaintAxis (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
 Control function to draw an axis. More...
 
virtual void Rotate (Double_t X, Double_t Y, Double_t CFI, Double_t SFI, Double_t XT, Double_t YT, Double_t &U, Double_t &V)
 Internal method to rotate axis coordinates. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save primitive as a C++ statement(s) on output stream out. More...
 
void SetFunction (const char *funcname="")
 Specify a function to map the axis values. More...
 
void SetOption (Option_t *option="")
 To set axis options. More...
 
void SetLabelColor (Int_t labelcolor)
 
void SetLabelFont (Int_t labelfont)
 
void SetLabelOffset (Float_t labeloffset)
 
void SetLabelSize (Float_t labelsize)
 
virtual void SetName (const char *name)
 Change the name of the axis. More...
 
virtual void SetNdivisions (Int_t ndiv)
 
virtual void SetMoreLogLabels (Bool_t more=kTRUE)
 Set the kMoreLogLabels bit flag. More...
 
virtual void SetNoExponent (Bool_t noExponent=kTRUE)
 Set the NoExponent flag. More...
 
virtual void SetDecimals (Bool_t dot=kTRUE)
 Set the decimals flag. More...
 
void SetTickSize (Float_t ticksize)
 
void SetTickLength (Float_t ticklength)
 
void SetGridLength (Float_t gridlength)
 
void SetTimeFormat (const char *tformat)
 Change the format used for time plotting. More...
 
void SetTimeOffset (Double_t toffset, Option_t *option="local")
 Change the time offset. If option = "gmt", set display mode to GMT. More...
 
virtual void SetTitle (const char *title="")
 Change the title of the axis. More...
 
void SetTitleOffset (Float_t titleoffset=1)
 
void SetTitleSize (Float_t titlesize)
 
void SetTitleFont (Int_t titlefont)
 
void SetTitleColor (Int_t titlecolor)
 
void SetWmin (Double_t wmin)
 
void SetWmax (Double_t wmax)
 
- Public Member Functions inherited from TLine
 TLine ()
 
 TLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Line normal constructor. More...
 
 TLine (const TLine &line)
 Line copy constructor. More...
 
virtual ~TLine ()
 Line default destructor. More...
 
void Copy (TObject &line) const
 Copy this line to line. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Compute distance from point px,py to a line. More...
 
virtual TLineDrawLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates. More...
 
virtual TLineDrawLineNDC (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates in NDC. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to one event. More...
 
Double_t GetX1 () const
 
Double_t GetX2 () const
 
Double_t GetY1 () const
 
Double_t GetY2 () const
 
Bool_t IsHorizontal ()
 Check whether this line is to be drawn horizontally. More...
 
Bool_t IsVertical ()
 Check whether this line is to be drawn vertically. More...
 
virtual void ls (Option_t *option="") const
 List this line with its attributes. More...
 
virtual void PaintLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates. More...
 
virtual void PaintLineNDC (Double_t u1, Double_t v1, Double_t u2, Double_t v2)
 Draw this line with new coordinates in NDC. More...
 
virtual void Print (Option_t *option="") const
 Dump this line with its attributes. More...
 
virtual void SetNDC (Bool_t isNDC=kTRUE)
 Set NDC mode on if isNDC = kTRUE, off otherwise. More...
 
void SetHorizontal (Bool_t set=kTRUE)
 Force the line to be drawn horizontally. More...
 
void SetVertical (Bool_t set=kTRUE)
 Force the line to be drawn vertically. More...
 
virtual void SetX1 (Double_t x1)
 
virtual void SetX2 (Double_t x2)
 
virtual void SetY1 (Double_t y1)
 
virtual void SetY2 (Double_t y2)
 
virtual Rectangle_t GetBBox ()
 Return the bounding Box of the Line. More...
 
virtual TPoint GetBBoxCenter ()
 Return the center of the BoundingBox as TPoint in pixels. More...
 
virtual void SetBBoxCenter (const TPoint &p)
 Set center of the BoundingBox. More...
 
virtual void SetBBoxCenterX (const Int_t x)
 Set X coordinate of the center of the BoundingBox. More...
 
virtual void SetBBoxCenterY (const Int_t y)
 Set Y coordinate of the center of the BoundingBox. More...
 
virtual void SetBBoxX1 (const Int_t x)
 Set left hand side of BoundingBox to a value (resize in x direction on left) More...
 
virtual void SetBBoxX2 (const Int_t x)
 Set right hand side of BoundingBox to a value (resize in x direction on right) More...
 
virtual void SetBBoxY1 (const Int_t y)
 Set top of BoundingBox to a value (resize in y direction on top) More...
 
virtual void SetBBoxY2 (const Int_t y)
 Set bottom of BoundingBox to a value (resize in y direction on bottom) More...
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current pad. More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsSortable () const
 
Bool_t IsOnHeap () const
 
Bool_t IsZombie () const
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
voidoperator new (size_t sz)
 
voidoperator new[] (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz, void *vp)
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
void SetBit (UInt_t f)
 
void ResetBit (UInt_t f)
 
Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
void InvertBit (UInt_t f)
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
- Public Member Functions inherited from TAttLine
 TAttLine ()
 AttLine default constructor. More...
 
 TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth)
 AttLine normal constructor. More...
 
virtual ~TAttLine ()
 AttLine destructor. More...
 
void Copy (TAttLine &attline) const
 Copy this line attributes to a new TAttLine. More...
 
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
 Compute distance from point px,py to a line. More...
 
virtual Color_t GetLineColor () const
 
virtual Style_t GetLineStyle () const
 
virtual Width_t GetLineWidth () const
 
virtual void Modify ()
 Change current line attributes if necessary. More...
 
virtual void ResetAttLine (Option_t *option="")
 Reset this line attributes to default values. More...
 
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
 Save line attributes as C++ statement(s) on output stream out. More...
 
virtual void SetLineAttributes ()
 Invoke the DialogCanvas Line attributes. More...
 
virtual void SetLineColor (Color_t lcolor)
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 Set a transparent line color. More...
 
virtual void SetLineStyle (Style_t lstyle)
 
virtual void SetLineWidth (Width_t lwidth)
 
 ClassDef (TAttLine, 2)
 
- Public Member Functions inherited from TAttBBox2D
virtual ~TAttBBox2D ()
 
 ClassDef (TAttBBox2D, 0)
 
- Public Member Functions inherited from TAttText
 TAttText ()
 
 TAttText (Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize)
 AttText normal constructor. More...
 
virtual ~TAttText ()
 AttText destructor. More...
 
void Copy (TAttText &atttext) const
 Copy this text attributes to a new TAttText. More...
 
virtual Short_t GetTextAlign () const
 
virtual Float_t GetTextAngle () const
 
virtual Color_t GetTextColor () const
 
virtual Font_t GetTextFont () const
 
virtual Float_t GetTextSize () const
 
virtual void Modify ()
 Change current text attributes if necessary. More...
 
virtual void ResetAttText (Option_t *toption="")
 Reset this text attributes to default values. More...
 
virtual void SaveTextAttributes (std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
 Save text attributes as C++ statement(s) on output stream out. More...
 
virtual void SetTextAttributes ()
 Invoke the DialogCanvas Text attributes. More...
 
virtual void SetTextAlign (Short_t align=11)
 
virtual void SetTextAngle (Float_t tangle=0)
 
virtual void SetTextColor (Color_t tcolor=1)
 
virtual void SetTextColorAlpha (Color_t tcolor, Float_t talpha)
 Set a transparent marker color. More...
 
virtual void SetTextFont (Font_t tfont=62)
 
virtual void SetTextSize (Float_t tsize=1)
 
virtual void SetTextSizePixels (Int_t npixels)
 Set the text size in pixels. More...
 

Static Public Member Functions

static Int_t GetMaxDigits ()
 Static function returning fgMaxDigits (See SetMaxDigits). More...
 
static void SetMaxDigits (Int_t maxd=5)
 Static function to set fgMaxDigits for axis. More...
 
static void SetExponentOffset (Float_t xoff=0., Float_t yoff=0., Option_t *axis="xy")
 Static function to set X and Y offset of the axis 10^n notation. More...
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Protected Member Functions

 TGaxis (const TGaxis &)
 Exponent Y offset for the Y axis. More...
 
TGaxisoperator= (const TGaxis &)
 Assignment operator. More...
 
- Protected Member Functions inherited from TObject
void MakeZombie ()
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 

Protected Attributes

Double_t fWmin
 
Double_t fWmax
 
Float_t fGridLength
 
Float_t fTickSize
 
Float_t fLabelOffset
 
Float_t fLabelSize
 
Float_t fTitleOffset
 
Float_t fTitleSize
 
Int_t fNdiv
 
Int_t fLabelColor
 
Int_t fLabelFont
 
TString fChopt
 
TString fName
 
TString fTitle
 
TString fTimeFormat
 
TString fFunctionName
 
TF1fFunction
 
TAxisfAxis
 Pointer to function computing axis values. More...
 
- Protected Attributes inherited from TLine
Double_t fX1
 
Double_t fY1
 
Double_t fX2
 
Double_t fY2
 
- Protected Attributes inherited from TAttLine
Color_t fLineColor
 
Style_t fLineStyle
 
Width_t fLineWidth
 
- Protected Attributes inherited from TAttText
Float_t fTextAngle
 
Float_t fTextSize
 
Short_t fTextAlign
 
Color_t fTextColor
 
Font_t fTextFont
 

Static Protected Attributes

static Int_t fgMaxDigits = 5
 pointer to original TAxis axis (if any) More...
 
static Float_t fXAxisExpXOffset = 0.
 Number of digits above which the 10>N notation is used. More...
 
static Float_t fXAxisExpYOffset = 0.
 Exponent X offset for the X axis. More...
 
static Float_t fYAxisExpXOffset = 0.
 Exponent Y offset for the X axis. More...
 
static Float_t fYAxisExpYOffset = 0.
 Exponent X offset for the Y axis. More...
 

Additional Inherited Members

- Public Types inherited from TLine
enum  { kLineNDC = BIT(14), kVertical = BIT(15), kHorizontal = BIT(16) }
 
- Public Types inherited from TObject
enum  EStatusBits {
  kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4),
  kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13)
}
 
enum  { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff }
 
enum  { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) }
 

#include <TGaxis.h>

+ Inheritance diagram for TGaxis:
+ Collaboration diagram for TGaxis:

Constructor & Destructor Documentation

TGaxis::TGaxis ( const TGaxis ax)
protected

Exponent Y offset for the Y axis.

Copy constructor.

Definition at line 529 of file TGaxis.cxx.

TGaxis::TGaxis ( )

Referenced by DrawAxis().

TGaxis::TGaxis ( Double_t  xmin,
Double_t  ymin,
Double_t  xmax,
Double_t  ymax,
Double_t  wmin,
Double_t  wmax,
Int_t  ndiv = 510,
Option_t chopt = "",
Double_t  gridlength = 0 
)

TGaxis normal constructor.

Definition at line 465 of file TGaxis.cxx.

TGaxis::TGaxis ( Double_t  xmin,
Double_t  ymin,
Double_t  xmax,
Double_t  ymax,
const char *  funcname,
Int_t  ndiv = 510,
Option_t chopt = "",
Double_t  gridlength = 0 
)

Constructor with a TF1 to map axis values.

Definition at line 494 of file TGaxis.cxx.

TGaxis::~TGaxis ( )
virtual

TGaxis default destructor.

Definition at line 587 of file TGaxis.cxx.

Member Function Documentation

void TGaxis::AdjustBinSize ( Double_t  A1,
Double_t  A2,
Int_t  nold,
Double_t binLow,
Double_t binHigh,
Int_t nbins,
Double_t binWidth 
)
virtual

Internal method for axis labels optimisation.

This method adjusts the bining of the axis in order to have integer values for the labels.

Parameters
[in]A1,A2Old WMIN,WMAX
[out]binLow,binHighNew WMIN,WMAX
[in]noldOld NDIV (primary divisions)
[out]nbinsNew NDIV
[out]binWidthBin width

Definition at line 2078 of file TGaxis.cxx.

Referenced by PaintAxis().

void TGaxis::CenterLabels ( Bool_t  center = kTRUE)
virtual

If center = kTRUE axis labels are centered in the center of the bin.

The default is to center on the primary tick marks. This option does not make sense if there are more bins than tick marks.

Definition at line 596 of file TGaxis.cxx.

void TGaxis::CenterTitle ( Bool_t  center = kTRUE)
virtual

If center = kTRUE axis title will be centered. The default is right adjusted.

Definition at line 606 of file TGaxis.cxx.

void TGaxis::DrawAxis ( Double_t  xmin,
Double_t  ymin,
Double_t  xmax,
Double_t  ymax,
Double_t  wmin,
Double_t  wmax,
Int_t  ndiv = 510,
Option_t chopt = "",
Double_t  gridlength = 0 
)
virtual

Draw this axis with new attributes.

Definition at line 616 of file TGaxis.cxx.

TF1* TGaxis::GetFunction ( ) const
inline

Definition at line 89 of file TGaxis.h.

Float_t TGaxis::GetGridLength ( ) const
inline

Definition at line 88 of file TGaxis.h.

Referenced by SavePrimitive().

Int_t TGaxis::GetLabelColor ( ) const
inline

Definition at line 90 of file TGaxis.h.

Referenced by PaintAxis(), TPaletteAxis::SavePrimitive(), and SavePrimitive().

Int_t TGaxis::GetLabelFont ( ) const
inline

Definition at line 91 of file TGaxis.h.

Referenced by PaintAxis(), TPaletteAxis::SavePrimitive(), and SavePrimitive().

Float_t TGaxis::GetLabelOffset ( ) const
inline
Float_t TGaxis::GetLabelSize ( ) const
inline

Definition at line 93 of file TGaxis.h.

Referenced by PaintAxis(), TPaletteAxis::SavePrimitive(), and SavePrimitive().

Int_t TGaxis::GetMaxDigits ( )
static

Static function returning fgMaxDigits (See SetMaxDigits).

Definition at line 646 of file TGaxis.cxx.

virtual const char* TGaxis::GetName ( ) const
inlinevirtual

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 96 of file TGaxis.h.

Referenced by SavePrimitive().

Int_t TGaxis::GetNdiv ( ) const
inline

Definition at line 100 of file TGaxis.h.

virtual const char* TGaxis::GetOption ( ) const
inlinevirtual

Reimplemented from TObject.

Definition at line 97 of file TGaxis.h.

Float_t TGaxis::GetTickSize ( ) const
inline

Definition at line 103 of file TGaxis.h.

Referenced by TSpectrum2Painter::Paint(), and SavePrimitive().

virtual const char* TGaxis::GetTitle ( ) const
inlinevirtual

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 98 of file TGaxis.h.

Referenced by DrawAxis(), PaintAxis(), and SavePrimitive().

Float_t TGaxis::GetTitleOffset ( ) const
inline

Definition at line 94 of file TGaxis.h.

Referenced by PaintAxis(), TPaletteAxis::SavePrimitive(), and SavePrimitive().

Float_t TGaxis::GetTitleSize ( ) const
inline

Definition at line 95 of file TGaxis.h.

Referenced by PaintAxis(), TPaletteAxis::SavePrimitive(), and SavePrimitive().

Double_t TGaxis::GetWmax ( ) const
inline

Definition at line 102 of file TGaxis.h.

Double_t TGaxis::GetWmin ( ) const
inline

Definition at line 101 of file TGaxis.h.

void TGaxis::ImportAxisAttributes ( TAxis axis)
virtual

Internal method to import TAxis attributes to this TGaxis.

Definition at line 655 of file TGaxis.cxx.

Referenced by Rgl::Draw2DAxis(), TPaletteAxis::Paint(), THistPainter::PaintAxis(), THistPainter::PaintLegoAxis(), and TPaletteAxis::TPaletteAxis().

void TGaxis::LabelsLimits ( const char *  label,
Int_t first,
Int_t last 
)

Internal method to find first and last character of a label.

Definition at line 2113 of file TGaxis.cxx.

Referenced by PaintAxis(), and TGraphPolargram::PaintPolarDivisions().

TGaxis & TGaxis::operator= ( const TGaxis ax)
protected

Assignment operator.

Definition at line 556 of file TGaxis.cxx.

void TGaxis::Paint ( Option_t chopt = "")
virtual

Draw this axis with its current attributes.

Reimplemented from TLine.

Definition at line 684 of file TGaxis.cxx.

Referenced by Rgl::DrawPaletteAxis(), TSpectrum2Painter::Paint(), and TTreePerfStats::Paint().

void TGaxis::PaintAxis ( Double_t  xmin,
Double_t  ymin,
Double_t  xmax,
Double_t  ymax,
Double_t wmin,
Double_t wmax,
Int_t ndiv,
Option_t chopt = "",
Double_t  gridlength = 0,
Bool_t  drawGridOnly = kFALSE 
)
virtual

Control function to draw an axis.

Original authors: O.Couet C.E.Vandoni N.Cremel-Somon. Modified and converted to C++ class by Rene Brun.

Definition at line 705 of file TGaxis.cxx.

Referenced by Rgl::Draw2DAxis(), TSpectrum2Painter::Paint(), TPaletteAxis::Paint(), TASImage::Paint(), Paint(), THistPainter::PaintAxis(), TAxis3D::PaintAxis(), TGraphPainter::PaintGrapHist(), THistPainter::PaintLegoAxis(), and TGraphPolargram::PaintRadialDivisions().

void TGaxis::Rotate ( Double_t  X,
Double_t  Y,
Double_t  CFI,
Double_t  SFI,
Double_t  XT,
Double_t  YT,
Double_t U,
Double_t V 
)
virtual

Internal method to rotate axis coordinates.

Definition at line 2125 of file TGaxis.cxx.

Referenced by PaintAxis().

void TGaxis::SavePrimitive ( std::ostream &  out,
Option_t option = "" 
)
virtual

Save primitive as a C++ statement(s) on output stream out.

Reimplemented from TLine.

Definition at line 2135 of file TGaxis.cxx.

void TGaxis::SetDecimals ( Bool_t  dot = kTRUE)
virtual

Set the decimals flag.

By default, blank characters are stripped, and then the label is correctly aligned. The dot, if last character of the string, is also stripped, unless this option is specified. One can disable the option by calling axis.SetDecimals(kTRUE). Note the bit is set in fBits (as opposed to fBits2 in TAxis!)

Definition at line 2201 of file TGaxis.cxx.

void TGaxis::SetExponentOffset ( Float_t  xoff = 0.,
Float_t  yoff = 0.,
Option_t axis = "xy" 
)
static

Static function to set X and Y offset of the axis 10^n notation.

It is in % of the pad size. It can be negative. axis specifies which axis ("x","y"), default = "x" if axis="xz" set the two axes

Definition at line 2367 of file TGaxis.cxx.

void TGaxis::SetFunction ( const char *  funcname = "")

Specify a function to map the axis values.

Definition at line 2210 of file TGaxis.cxx.

void TGaxis::SetGridLength ( Float_t  gridlength)
inline

Definition at line 127 of file TGaxis.h.

void TGaxis::SetLabelColor ( Int_t  labelcolor)
inline
void TGaxis::SetLabelFont ( Int_t  labelfont)
inline
void TGaxis::SetLabelOffset ( Float_t  labeloffset)
inline
void TGaxis::SetLabelSize ( Float_t  labelsize)
inline
void TGaxis::SetMaxDigits ( Int_t  maxd = 5)
static

Static function to set fgMaxDigits for axis.

fgMaxDigits 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.

Definition at line 2233 of file TGaxis.cxx.

void TGaxis::SetMoreLogLabels ( Bool_t  more = kTRUE)
virtual

Set the kMoreLogLabels bit flag.

When this option is selected more labels are drawn when in logarithmic scale and there is a small number of decades (less than 3). Note that this option is automatically inherited from TAxis

Definition at line 2252 of file TGaxis.cxx.

void TGaxis::SetName ( const char *  name)
virtual

Change the name of the axis.

Definition at line 2242 of file TGaxis.cxx.

Referenced by TTreePerfStats::Paint().

virtual void TGaxis::SetNdivisions ( Int_t  ndiv)
inlinevirtual

Definition at line 121 of file TGaxis.h.

void TGaxis::SetNoExponent ( Bool_t  noExponent = kTRUE)
virtual

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).

Definition at line 2263 of file TGaxis.cxx.

void TGaxis::SetOption ( Option_t option = "")

To set axis options.

Definition at line 2272 of file TGaxis.cxx.

Referenced by Rgl::Draw2DAxis(), THistPainter::PaintAxis(), TAxis3D::PaintAxis(), and THistPainter::PaintLegoAxis().

void TGaxis::SetTickLength ( Float_t  ticklength)
inline

Definition at line 126 of file TGaxis.h.

void TGaxis::SetTickSize ( Float_t  ticksize)
inline
void TGaxis::SetTimeFormat ( const char *  tformat)

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)
  • %% %

Definition at line 2307 of file TGaxis.cxx.

Referenced by Rgl::Draw2DAxis(), ImportAxisAttributes(), THistPainter::PaintAxis(), TAxis3D::PaintAxis(), and THistPainter::PaintLegoAxis().

void TGaxis::SetTimeOffset ( Double_t  toffset,
Option_t option = "local" 
)

Change the time offset. If option = "gmt", set display mode to GMT.

Definition at line 2331 of file TGaxis.cxx.

Referenced by SetTimeFormat().

void TGaxis::SetTitle ( const char *  title = "")
virtual
void TGaxis::SetTitleColor ( Int_t  titlecolor)
inline

Definition at line 134 of file TGaxis.h.

Referenced by TMVA::StatDialogMVAEffs::DrawHistograms(), and TTreePerfStats::Paint().

void TGaxis::SetTitleFont ( Int_t  titlefont)
inline

Definition at line 133 of file TGaxis.h.

void TGaxis::SetTitleOffset ( Float_t  titleoffset = 1)
inline
void TGaxis::SetTitleSize ( Float_t  titlesize)
inline
void TGaxis::SetWmax ( Double_t  wmax)
inline

Definition at line 136 of file TGaxis.h.

Referenced by TMVA::StatDialogMVAEffs::UpdateCanvases().

void TGaxis::SetWmin ( Double_t  wmin)
inline

Definition at line 135 of file TGaxis.h.

Member Data Documentation

TAxis* TGaxis::fAxis
protected

Pointer to function computing axis values.

Definition at line 59 of file TGaxis.h.

Referenced by ImportAxisAttributes(), operator=(), PaintAxis(), and TGaxis().

TString TGaxis::fChopt
protected

Definition at line 53 of file TGaxis.h.

Referenced by operator=(), Paint(), PaintAxis(), SavePrimitive(), SetOption(), and TGaxis().

TF1* TGaxis::fFunction
protected

Definition at line 58 of file TGaxis.h.

Referenced by GetFunction(), operator=(), PaintAxis(), SetFunction(), and TGaxis().

TString TGaxis::fFunctionName
protected

Definition at line 57 of file TGaxis.h.

Referenced by operator=(), PaintAxis(), SetFunction(), and TGaxis().

Int_t TGaxis::fgMaxDigits = 5
staticprotected

pointer to original TAxis axis (if any)

Definition at line 61 of file TGaxis.h.

Referenced by GetMaxDigits(), PaintAxis(), and SetMaxDigits().

Float_t TGaxis::fGridLength
protected

Definition at line 44 of file TGaxis.h.

Referenced by GetGridLength(), operator=(), Paint(), and TGaxis().

Int_t TGaxis::fLabelColor
protected

Definition at line 51 of file TGaxis.h.

Referenced by DrawAxis(), GetLabelColor(), operator=(), SavePrimitive(), and TGaxis().

Int_t TGaxis::fLabelFont
protected

Definition at line 52 of file TGaxis.h.

Referenced by DrawAxis(), GetLabelFont(), operator=(), SavePrimitive(), and TGaxis().

Float_t TGaxis::fLabelOffset
protected

Definition at line 46 of file TGaxis.h.

Referenced by DrawAxis(), GetLabelOffset(), operator=(), PaintAxis(), and TGaxis().

Float_t TGaxis::fLabelSize
protected

Definition at line 47 of file TGaxis.h.

Referenced by DrawAxis(), GetLabelSize(), operator=(), PaintAxis(), and TGaxis().

TString TGaxis::fName
protected

Definition at line 54 of file TGaxis.h.

Referenced by operator=(), SetName(), and TGaxis().

Int_t TGaxis::fNdiv
protected

Definition at line 50 of file TGaxis.h.

Referenced by GetNdiv(), operator=(), Paint(), SavePrimitive(), and TGaxis().

Float_t TGaxis::fTickSize
protected

Definition at line 45 of file TGaxis.h.

Referenced by DrawAxis(), GetTickSize(), operator=(), PaintAxis(), and TGaxis().

TString TGaxis::fTimeFormat
protected

Definition at line 56 of file TGaxis.h.

Referenced by operator=(), PaintAxis(), SetTimeFormat(), SetTimeOffset(), and TGaxis().

TString TGaxis::fTitle
protected

Definition at line 55 of file TGaxis.h.

Referenced by operator=(), SetTitle(), and TGaxis().

Float_t TGaxis::fTitleOffset
protected

Definition at line 48 of file TGaxis.h.

Referenced by DrawAxis(), GetTitleOffset(), operator=(), and TGaxis().

Float_t TGaxis::fTitleSize
protected

Definition at line 49 of file TGaxis.h.

Referenced by DrawAxis(), GetTitleSize(), operator=(), and TGaxis().

Double_t TGaxis::fWmax
protected

Definition at line 43 of file TGaxis.h.

Referenced by GetWmax(), operator=(), Paint(), SavePrimitive(), SetFunction(), and TGaxis().

Double_t TGaxis::fWmin
protected

Definition at line 42 of file TGaxis.h.

Referenced by GetWmin(), operator=(), Paint(), SavePrimitive(), SetFunction(), and TGaxis().

Float_t TGaxis::fXAxisExpXOffset = 0.
staticprotected

Number of digits above which the 10>N notation is used.

Definition at line 62 of file TGaxis.h.

Referenced by PaintAxis(), and SetExponentOffset().

Float_t TGaxis::fXAxisExpYOffset = 0.
staticprotected

Exponent X offset for the X axis.

Definition at line 63 of file TGaxis.h.

Referenced by PaintAxis(), and SetExponentOffset().

Float_t TGaxis::fYAxisExpXOffset = 0.
staticprotected

Exponent Y offset for the X axis.

Definition at line 64 of file TGaxis.h.

Referenced by PaintAxis(), and SetExponentOffset().

Float_t TGaxis::fYAxisExpYOffset = 0.
staticprotected

Exponent X offset for the Y axis.

Definition at line 65 of file TGaxis.h.

Referenced by PaintAxis(), and SetExponentOffset().


The documentation for this class was generated from the following files: