Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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:

const char Option_t
Option string (const char)
Definition RtypesCore.h:80
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
float xmin
float ymin
float xmax
float ymax
TGaxis()
TGaxis default constructor.
Definition TGaxis.cxx:693

Where:

  • xmin : X origin coordinate in user's coordinates space.
  • xmax : X end axis coordinate in user's coordinates space.
  • ymin : Y origin coordinate in user's coordinates space.
  • ymax : Y end axis coordinate in user's coordinates 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.:
      • ndiv=0 --> no tick marks.
      • ndiv=2 --> 2 divisions, one tick mark in the middle of the axis.
  • chopt : Drawing options (see below).
  • gridlength: grid length on main tick marks.

The example below generates various kind of axis.

void gaxis()
{
auto c1 = new TCanvas("c1", "Examples of TGaxis", 10, 10, 700, 500);
c1->Range(-10, -1, 10, 1);
auto axis1 = new TGaxis(-4.5, -0.2, 5.5, -0.2, -6, 8, 510, "");
axis1->Draw();
auto axis2 = new TGaxis(-4.5, 0.2, 5.5, 0.2, 0.001, 10000, 510, "G");
axis2->Draw();
auto axis3 = new TGaxis(-9, -0.8, -9, 0.8, -8, 8, 50510, "");
axis3->SetTitle("axis3");
axis3->SetTitleOffset(0.5);
axis3->Draw();
auto axis4 = new TGaxis(-7, -0.8, -7, 0.8, 1, 10000, 50510, "G");
axis4->SetTitle("axis4");
axis4->Draw();
auto axis5 = new TGaxis(-4.5, -0.6, 5.5, -0.6, 1.2, 1.32, 80506, "-+");
axis5->SetLabelSize(0.03);
axis5->SetTextFont(72);
axis5->Draw();
auto axis6 = new TGaxis(-4.5, 0.5, 5.5, 0.5, 100, 900, 50510, "-");
axis6->Draw();
auto axis7 = new TGaxis(-5.5, 0.85, 5.5, 0.85, 0, 4.3e-6, 510, "");
axis7->Draw();
auto axis8 = new TGaxis(8, -0.8, 8, 0.8, 0, 9000, 50510, "+L");
axis8->Draw();
// One can make a vertical axis going top->bottom.
// However one need to adjust labels align to avoid overlapping.
auto axis9 = new TGaxis(6.5, 0.8, 6.5, -0.8, 0, 90, 50510, "-L");
axis9->Draw();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
The axis painter class.
Definition TGaxis.h:26
return c1
Definition legend1.C:41

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:

Where:

  • xmin : X origin coordinate in user's coordinates space.
  • xmax : X end axis coordinate in user's coordinates space.
  • ymin : Y origin coordinate in user's coordinates space.
  • ymax : Y end axis coordinate in user's coordinates space.
  • func : function defining axis labels and tick marks.
  • 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.:
      • ndiv=0 --> no tick marks.
      • ndiv=2 --> 2 divisions, one tick mark in the middle of the axis.
  • chopt : Drawing options (see below).
  • gridlength: grid length on main tick marks.

It should be noted that func is not defined in the user's coordinate space, but in the new TGaxis space. If x is the original axis, w the new axis, and w = f(x) (for example, f is a calibration function converting ADC channels x to energy w), then func must be supplied as f^{-1}(w).

Examples:

{
TCanvas *c2 = new TCanvas("c2","c2",10,10,700,500);
gPad->DrawFrame(0.,-2.,10.,2);
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,"");
A3->SetTitle("logarithmic axis");
A3->SetLabelSize(0.02);
A3->SetTitleSize(0.03);
A3->SetTitleOffset(0.); // Axis title automatically placed
A3->Draw();
}
#define gPad
1-Dim function class
Definition TF1.h:182
TF1 * f1
Definition legend1.C:11
return c2
Definition legend2.C:14

Note that this functionality has some limitations and does not follow all the TGaxis setting. In particular the number of divisions or the maximum number digits do not apply.

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:

  • gPad->SetLogx(1); set the logarithmic scale on the X axis
  • gPad->SetLogy(1); set the logarithmic scale on the Y axis

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.

Arrow on axis

Since
ROOT version 6.27/01:

To draw an arrow at the end of the axis use the option ">". To draw it at the beginning of the axis use the option "<". To draw it on both ends use "<>".

{
auto c = new TCanvas("c","c",0,0,500,500);
c->Range(-11,-11,11,11);
auto f2 = new TF1("x2","x*x",-10,10);
f2->Draw("same");
auto f3 = new TF1("x3","x*x*x",-10,10);
f3->Draw("same");
// Draw the axis with arrows
auto ox = new TGaxis(-10,0,10,0,-10.,10.,510,"+-S>");
ox->SetTickSize(0.009);
ox->SetLabelFont(42);
ox->SetLabelSize(0.025);
ox->Draw();
auto oy = new TGaxis(0,-10,0,10,-10,10,510,"+-S>");
oy->SetTickSize(0.009);
oy->SetLabelFont(42);
oy->SetLabelSize(0.025);
oy->Draw();
}
#define c(i)
Definition RSha256.hxx:101
@ kRed
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:44
void Draw(Option_t *option="") override
Draw this function with its current attributes.
Definition TF1.cxx:1340

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:

  • chopt = "+": tick marks are drawn on Positive side. (default)
  • chopt ="-": tick mark are drawn on the negative side.
  • chopt = "+-": tick marks are drawn on both sides of the axis.
  • chopt = "U": Unlabelled axis, default is labeled.

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:

  • h->GetXaxis()->SetTickLength(0.02); set the tick length for the X axis
  • gStyle->SetTickLength(0.02,"x"); set the tick length for the X axis of all histograms drawn after this instruction.

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

Labels' positioning

Labels are normally drawn on side opposite to tick marks. However the option "=" allows to draw them on the same side. The distance between the labels and the axis body can be changed with SetLabelOffset.

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:

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

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:

  • Primary tick marks: 3.0 %
  • Secondary tick marks: 1.5 %
  • Third order tick marks: .75 %
  • Characters height for labels: 4%
  • Labels offset: 1.0 %

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.

{
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->SetCanExtend(TH1::kAllAxes);
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->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();
}
#define h(i)
Definition RSha256.hxx:106
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:40
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:48
@ kAllAxes
Definition TH1.h:126
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:345
A Pave (see TPave) with text, lines or/and boxes inside.
Definition TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition TRandom.cxx:614
Double_t Rndm() override
Machine independent random number generator.
Definition TRandom.cxx:558
TPaveText * pt

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

Changing axis labels

Since
ROOT version 6.07/07:

After an axis has been created, TGaxis::ChangeLabel allows to define new text attributes for a given label. A fine tuning of the labels can be done. All the attributes can be changed as well as the text label itself.

When plotting an histogram or a graph the labels can be changed like in the following example which shows a way to produce \(\pi\)-axis :

{
TF1* f = new TF1("f","TMath::Cos(x/TMath::Pi())", -pi, pi);
TAxis* a = f->GetXaxis();
a->SetNdivisions(-502);
a->ChangeLabel(1,-1,-1,-1,-1,-1,"-#pi");
a->ChangeLabel(-1,-1,-1,-1,-1,-1,"#pi");
f->Draw();
}
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Definition TAttAxis.cxx:214
Class to manage histogram axis.
Definition TAxis.h:32
constexpr Double_t Pi()
Definition TMath.h:40

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

  • N1 = number of 1st divisions.
  • N2 = number of 2nd divisions.
  • N3 = number of 3rd divisions.

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

  • Directly on the histogram. The following will set the number of division to 510 on the X axis of h. To avoid optimization the number of divisions should be negative (ie: -510);
    h->SetNdivisions(510, "X");
  • On the axis itself:
    h->GetXaxis()->SetNdivisions(510, kTRUE);
    constexpr Bool_t kTRUE
    Definition RtypesCore.h:107

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 method 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. Warning: even when called on a particular TGaxis* instance, this static function changes globally the number of digits for all axes (X, Y, ...) in the canvas. If you want to change the maximum number of digits N only of the current TGaxis*, and not all the others, use axis->SetNdivisions(N*1000000 + (axis->GetNdiv()%1000000)) instead of axis->SetMaxDigits(N).

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:

  • gPad->SetGridy(1); set the grid on the X axis
  • gPad->SetGridx(1); set the grid on the Y axis
  • gPad->SetGrid(1,1); set the grid on both axis.

Time axis

Histograms' axis can be defined as "time axis". To do that it is enough to activate the TAxis::SetTimeDisplay attribute on a given axis. If h is an histogram, it is done the following way:

h->GetXaxis()->SetTimeDisplay(1); // The X axis is a time axis

Two parameters can be adjusted in order to define time axis:

The time format:

Defines the format of the labels along the time axis. It can be changed using the TAxis TAxis::SetTimeFormat. The time format is the one used by the C function strftime(). It's a string containing the following formatting characters:

  • 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. For example to have a format like dd/mm/yyyy one should do:

h->GetXaxis()->SetTimeFormat("%d\/%m\/%Y");

The time offset:

This is a time in seconds in the UNIX standard UTC format (this is an universal time, not the local time), defining the starting date of an histogram axis. This date should be greater than 01/01/95 and is given in seconds. There are three ways to define the time offset:

By setting the global default time offset:

TDatime da(2003,02,28,12,00,00);
gStyle->SetTimeOffset(da.Convert());
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition TDatime.h:37
void SetTimeOffset(Double_t toffset)
Change the time offset for time plotting.
Definition TStyle.cxx:1914

If no time offset is defined for a particular axis, the default time offset will be used. In the example above, notice the usage of TDateTime to translate an explicit date into the time in seconds required by TAxis::SetTimeFormat.

By setting a time offset to a particular axis:

TDatime dh(2001,09,23,15,00,00);
h->GetXaxis()->SetTimeOffset(dh.Convert());

Together with the time format using TAxis::SetTimeFormat:

The time offset can be specified using the control character F after the normal time format. F is followed by the date in the format: yyyy-mm-dd hh:mm:ss.

Example:

h->GetXaxis()->SetTimeFormat("%d\/%m\/%y%F2000-02-28 13:00:01");

Notice that this date format is the same used by the TDateString function AsSQLString. If needed, this function can be used to translate a time in seconds into a character string which can be appended after F. If the time format is not specified (before `F), the automatic one will be used.

If a time axis has no specified time offset, the global time offset will be stored in the axis data structure.

The following example illustrates the various possibilities.

{
gStyle->SetTitleH(0.08);
TDatime da(2003,2,28,12,00,00);
gStyle->SetTimeOffset(da.Convert());
auto ct = new TCanvas("ct","Time on axis",0,0,600,600);
ct->Divide(1,3);
auto ht1 = new TH1F("ht1","ht1",30000,0.,200000.);
auto ht2 = new TH1F("ht2","ht2",30000,0.,200000.);
auto ht3 = new TH1F("ht3","ht3",30000,0.,200000.);
for (Int_t i=1;i<30000;i++) {
auto noise = gRandom->Gaus(0,120);
ht1->SetBinContent(i,noise);
ht2->SetBinContent(i,noise*noise);
ht3->SetBinContent(i,noise*noise*noise);
}
ct->cd(1);
ht1->GetXaxis()->SetLabelSize(0.06);
ht1->GetXaxis()->SetTimeDisplay(1);
ht1->GetXaxis()->SetTimeFormat("%d/%m/%y%F2000-02-28 13:00:01");
ht1->Draw();
ct->cd(2);
ht2->GetXaxis()->SetLabelSize(0.06);
ht2->GetXaxis()->SetTimeDisplay(1);
ht2->GetXaxis()->SetTimeFormat("%d/%m/%y");
ht2->Draw();
ct->cd(3);
ht3->GetXaxis()->SetLabelSize(0.06);
TDatime dh(2001,9,23,15,00,00);
ht3->GetXaxis()->SetTimeDisplay(1);
ht3->GetXaxis()->SetTimeOffset(dh.Convert());
ht3->Draw();
}
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition TRandom.cxx:274
void SetTitleH(Float_t h=0)
Definition TStyle.h:420

The histogram limits times in seconds. If wmin and wmax are the histogram limits, the time axis will spread around the time offset value from TimeOffset+wmin to TimeOffset+wmax. Until now all the examples had a lowest value equal to 0. The following example demonstrates how to define the histogram limits relatively to the time offset value.

{
// Define the time offset as 2003, January 1st
TDatime T0(2003,1,1,0,0,0);
auto X0 = T0.Convert();
// Define the lowest histogram limit as 2002, September 23rd
TDatime T1(2002,9,23,0,0,0);
auto X1 = T1.Convert()-X0;
// Define the highest histogram limit as 2003, March 7th
TDatime T2(2003,3,7,0,0,0);
auto X2 = T2.Convert(1)-X0;
auto 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->GetXaxis()->SetTimeFormat("%Y/%m/%d");
h1->Draw();
}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:184
virtual void SetTimeDisplay(Int_t value)
Definition TAxis.h:173
virtual void SetTimeFormat(const char *format="")
Change the format used for time plotting.
Definition TAxis.cxx:1165
TAxis * GetXaxis()
Definition TH1.h:571
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3393
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3097
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
TH1F * h1
Definition legend1.C:5
#define T2
Definition md5.inl:147
#define T1
Definition md5.inl:146

Usually time axis are created automatically via histograms, but one may also want to draw a time axis outside an "histogram context". Therefore it is useful to understand how TGaxis works for such axis.

The time offset can be defined using one of the three methods described before. The time axis will spread around the time offset value. Actually it will go from TimeOffset+wmin to TimeOffset+wmax where wmin and wmax are the minimum and maximum values (in seconds) of the axis. Let's take again an example. Having defined "2003, February 28 at 12h" we would like to see the axis a day before and a day after. A TGaxis can be created the following way (a day has 86400 seconds):

TGaxis *axis = new TGaxis(x1,y1,x2,y2,-100000,150000,2405,"t");
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1

the t option (in lower case) means it is a "time axis". The axis goes form 100000 seconds before TimeOffset and 150000 seconds after.

So the complete macro is:

{
auto 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.2);
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;
}
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
Definition TGaxis.cxx:2954
void SetTimeOffset(Double_t toffset, Option_t *option="local")
Change the time offset. If option = "gmt", set display mode to GMT.
Definition TGaxis.cxx:2978
void SetTickSize(Float_t ticksize)
Definition TGaxis.h:124
void SetLabelSize(Float_t labelsize)
Definition TGaxis.h:109
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:293

Thanks to the TLatex directive #splitline it is possible to write the time labels on two lines. In the previous example changing the SetTimeFormat line by

axis->SetLabelOffset(0.15);
axis->SetTimeFormat("#splitline{%Y}{%d\/%m}");
void SetLabelOffset(Float_t labeloffset)
Definition TGaxis.h:108

will produce the following axis:

The following example shows time axis on a TGraph:

{
TDatime da1(2008,02,28,15,52,00);
TDatime da2(2008,02,28,15,53,00);
double x[2],y[2];
y[0] = 1.;
y[1] = 2.;
x[0] = da1.Convert();
x[1] = da2.Convert();
TGraph mgr(2,x,y);
mgr.SetMarkerStyle(20);
mgr.Draw("apl");
mgr.GetXaxis()->SetTimeDisplay(1);
mgr.GetXaxis()->SetNdivisions(-503);
mgr.GetXaxis()->SetTimeFormat("%Y-%m-%d %H:%M");
mgr.GetXaxis()->SetTimeOffset(0,"gmt");
}
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17

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.

#include "TAxis.h"
#include "TGaxis.h"
#include "TCanvas.h"
#include "TString.h"
#include "TLine.h"
#include "TLatex.h"
#include <ctime>
#include <cstdio>
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];
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tt);
else
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tt);
return TString(buf);
}
{
double f = 1.8;
auto c = new TCanvas;
tex1.SetNDC();
tex1.SetTextFont(102);
tex1.SetTextSize(0.055 * f);
tex3.SetNDC();
tex3.SetTextFont(102);
tex3.SetTextSize(0.07 * f);
tex3.SetTextColor(kBlue + 2);
tex2.SetNDC();
tex2.SetTextFont(102);
tex2.SetTextSize(0.07 * f);
tex2.SetTextColor(kOrange + 3);
time_t offset[] = {0, 0, 1325376000, 1341100800};
time_t t[] = {1331150400, 1336417200, 0, 36000};
c->SetTopMargin(0);
c->SetBottomMargin(0);
c->SetLeftMargin(0);
c->SetRightMargin(0);
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->SetTopMargin(0);
p->SetBottomMargin(0);
p->SetLeftMargin(0);
p->SetRightMargin(0);
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 accessor
// 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]) {
snprintf(buf, 256, "#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);
snprintf(buf, 256, "#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];
snprintf(buf, 256, "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);
}
}
}
@ kOrange
Definition Rtypes.h:68
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
#define snprintf
Definition civetweb.c:1579
To draw Mathematical Formula.
Definition TLatex.h:20
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Definition TLine.cxx:103
Basic string class.
Definition TString.h:138
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4
auto * tt
Definition textangle.C:16

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

#include <ctime>
{
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
auto ct = new TCanvas("ct", "Time on axis", 10, 10, 700, 900);
ct->Divide(1, 3);
int i;
// ### Build a signal: noisy damped sine
// Time interval: 30 minutes
gStyle->SetTitleH(0.08);
float noise;
auto 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);
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 reasonable tick interval value is chosen.
ht->GetXaxis()->SetTimeDisplay(1);
// ### 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;
}
auto gt = new TGraph(100, t, x);
gt->SetTitle("Politics");
ct->cd(2);
gt->SetLineColor(5);
gt->SetLineWidth(2);
gt->Draw("AL");
gt->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
gt->GetXaxis()->SetTimeDisplay(1);
gPad->Modified();
// ### Build a second simple graph for a very long time interval
// Time interval: a few years
auto gt2 = new TGraph();
TDatime dateBegin(2000, 1, 1, 0, 0, 0);
for (i = 0; i < 10; i++) {
TDatime datePnt(2000 + i, 1, 1, 0, 0, 0);
gt2->AddPoint(datePnt.Convert() - dateBegin.Convert(), 100 + gRandom->Gaus(500, 100) * i);
}
gt2->SetTitle("Number of monkeys on the moon");
ct->cd(3);
gt2->SetMarkerColor(4);
gt2->SetMarkerStyle(29);
gt2->SetMarkerSize(1.3);
gt2->Draw("AP");
gt2->GetXaxis()->SetLabelSize(0.04);
gt2->GetXaxis()->SetNdivisions(10);
// Sets time on the X axis
gt2->GetXaxis()->SetTimeDisplay(1);
// 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("%d/%m/%Y %F2000-01-01 00:00:00");
}
RVec< PromoteType< T > > exp(const RVec< T > &v)
Definition RVec.hxx:1833
RVec< PromoteType< T > > sin(const RVec< T > &v)
Definition RVec.hxx:1847

Definition at line 26 of file TGaxis.h.

Public Types

enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  { kLineNDC = (1ULL << ( 14 )) , kVertical = (1ULL << ( 15 )) , kHorizontal = (1ULL << ( 16 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 TGaxis ()
 TGaxis default constructor.
 
 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.
 
 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.
 
 ~TGaxis () override
 TGaxis default destructor.
 
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
 
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.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
virtual void CenterLabels (Bool_t center=kTRUE)
 If center = kTRUE axis labels are centered in the center of the bin.
 
virtual void CenterTitle (Bool_t center=kTRUE)
 If center = kTRUE axis title will be centered. The default is right adjusted.
 
void ChangeLabel (Int_t labNum=0, Double_t labAngle=-1., Double_t labSize=-1., Int_t labAlign=-1, Int_t labColor=-1, Int_t labFont=-1, const TString &labText="")
 Define new text attributes for the label number "labNum".
 
void ChangeLabelAttributes (Int_t i, Int_t nlabels, TLatex *t, char *c, Double_t value=0., Double_t eps=-1.)
 Helper method used by TGaxis::ChangeLabel.
 
void ChangeLabelByValue (Double_t labValue, Double_t labAngle=-1., Double_t labSize=-1., Int_t labAlign=-1, Int_t labColor=-1, Int_t labFont=-1, const TString &labText="")
 Define new text attributes for the label value "labValue".
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility.
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method.
 
void Copy (TAttLine &attline) const
 Copy this line attributes to a new TAttLine.
 
void Copy (TAttText &atttext) const
 Copy this text attributes to a new TAttText.
 
void Copy (TObject &line) const override
 Copy this line to line.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
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.
 
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 Compute distance from point px,py to a line.
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects.
 
virtual TGaxisDrawAxis (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.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual TLineDrawLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates.
 
virtual TLineDrawLineNDC (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates in NDC.
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
void ExecuteEvent (Int_t event, Int_t px, Int_t py) override
 Execute action corresponding to one event.
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
Rectangle_t GetBBox () override
 Return the bounding Box of the Line.
 
virtual TPoint GetBBoxCenter ()
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
TF1GetFunction () const
 
Float_t GetGridLength () const
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
Int_t GetLabelColor () const
 
Int_t GetLabelFont () const
 
Float_t GetLabelOffset () const
 
Float_t GetLabelSize () const
 
virtual Color_t GetLineColor () const
 Return the line color.
 
virtual Style_t GetLineStyle () const
 Return the line style.
 
virtual Width_t GetLineWidth () const
 Return the line width.
 
const char * GetName () const override
 Returns name of object.
 
Int_t GetNdiv () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
const char * GetOption () const override
 
Double_t GetSlope () const
 Get the slope of this TLine.
 
virtual Short_t GetTextAlign () const
 Return the text alignment.
 
virtual Float_t GetTextAngle () const
 Return the text angle.
 
virtual Color_t GetTextColor () const
 Return the text color.
 
virtual Font_t GetTextFont () const
 Return the text font.
 
virtual Float_t GetTextSize () const
 Return the text size.
 
virtual Float_t GetTextSizePercent (Float_t size)
 Return the text in percent of the pad size.
 
virtual Float_t GetTextSizePixels (TVirtualPad &pad) const
 Return the text size in pixels for specified pad.
 
virtual Float_t GetTextSizeRelative (TVirtualPad &pad) const
 Return the text size in relative units.
 
Float_t GetTickSize () const
 
const char * GetTitle () const override
 Returns title of object.
 
Float_t GetTitleOffset () const
 
Float_t GetTitleSize () const
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
Double_t GetWmax () const
 
Double_t GetWmin () const
 
Double_t GetX1 () const
 
Double_t GetX2 () const
 
Double_t GetY1 () const
 
Double_t GetY2 () const
 
Double_t GetYIntercept () const
 Get the Y-Intercept of this TLine.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
virtual ULong_t Hash () const
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void ImportAxisAttributes (TAxis *axis)
 Internal method to import TAxis attributes to this TGaxis.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
TClassIsA () const override
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
Bool_t IsHorizontal ()
 Check whether this line is to be drawn horizontally.
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
Bool_t IsVertical ()
 Check whether this line is to be drawn vertically.
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void LabelsLimits (const char *label, Int_t &first, Int_t &last)
 Internal method to find first and last character of a label.
 
void ls (Option_t *option="") const override
 List this line with its attributes.
 
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).
 
virtual void Modify ()
 Change current line attributes if necessary.
 
virtual void Modify ()
 Change current text attributes if necessary.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current line attributes on specified pad.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current text attributes if necessary on specified pad.
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
void Paint (Option_t *chopt="") override
 Draw this axis with its current attributes.
 
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.
 
virtual void PaintLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this line with new coordinates.
 
virtual void PaintLineNDC (Double_t u1, Double_t v1, Double_t u2, Double_t v2)
 Draw this line with new coordinates in NDC.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
void Print (Option_t *option="") const override
 Dump this line with its attributes.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list.
 
virtual void ResetAttLine (Option_t *option="")
 Reset this line attributes to default values.
 
virtual void ResetAttText (Option_t *toption="")
 Reset this text attributes to default values.
 
void ResetBit (UInt_t f)
 
void ResetLabelAttributes (TLatex *t)
 Helper method used by TGaxis::ChangeLabel.
 
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.
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
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.
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 Save primitive as a C++ statement(s) on output stream out.
 
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.
 
virtual void SetBBoxCenter (const TPoint &p)
 
void SetBBoxCenterX (const Int_t x) override
 Set X coordinate of the center of the BoundingBox.
 
void SetBBoxCenterY (const Int_t y) override
 Set Y coordinate of the center of the BoundingBox.
 
void SetBBoxX1 (const Int_t x) override
 Set left hand side of BoundingBox to a value (resize in x direction on left)
 
void SetBBoxX2 (const Int_t x) override
 Set right hand side of BoundingBox to a value (resize in x direction on right)
 
void SetBBoxY1 (const Int_t y) override
 Set top of BoundingBox to a value (resize in y direction on top)
 
void SetBBoxY2 (const Int_t y) override
 Set bottom of BoundingBox to a value (resize in y direction on bottom)
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetDecimals (Bool_t dot=kTRUE)
 Set the decimals flag.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
void SetFunction (const char *funcname="")
 Specify a function to map the axis values.
 
void SetGridLength (Float_t gridlength)
 
void SetHorizontal (Bool_t set=kTRUE)
 Force the line to be drawn horizontally.
 
void SetLabelColor (Int_t labelcolor)
 
void SetLabelColor (TColorNumber lcolor)
 
void SetLabelFont (Int_t labelfont)
 
void SetLabelOffset (Float_t labeloffset)
 
void SetLabelSize (Float_t labelsize)
 
virtual void SetLineAttributes ()
 Invoke the DialogCanvas Line attributes.
 
virtual void SetLineColor (Color_t lcolor)
 Set the line color.
 
void SetLineColor (TColorNumber lcolor)
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 Set a transparent line color.
 
virtual void SetLineStyle (Style_t lstyle)
 Set the line style.
 
virtual void SetLineWidth (Width_t lwidth)
 Set the line width.
 
virtual void SetMoreLogLabels (Bool_t more=kTRUE)
 Set the kMoreLogLabels bit flag.
 
virtual void SetName (const char *name)
 Change the name of the axis.
 
virtual void SetNDC (Bool_t isNDC=kTRUE)
 Set NDC mode on if isNDC = kTRUE, off otherwise.
 
virtual void SetNdivisions (Int_t ndiv)
 
virtual void SetNoExponent (Bool_t noExponent=kTRUE)
 Set the NoExponent flag.
 
void SetOption (Option_t *option="")
 To set axis options.
 
virtual void SetTextAlign (Short_t align=11)
 Set the text alignment.
 
virtual void SetTextAngle (Float_t tangle=0)
 Set the text angle.
 
virtual void SetTextAttributes ()
 Invoke the DialogCanvas Text attributes.
 
virtual void SetTextColor (Color_t tcolor=1)
 Set the text color.
 
void SetTextColor (TColorNumber lcolor)
 
virtual void SetTextColorAlpha (Color_t tcolor, Float_t talpha)
 Set a transparent text color.
 
virtual void SetTextFont (Font_t tfont=62)
 Set the text font.
 
virtual void SetTextSize (Float_t tsize=1)
 Set the text size.
 
virtual void SetTextSizePixels (Int_t npixels)
 Set the text size in pixel.
 
void SetTickLength (Float_t ticklength)
 
void SetTickSize (Float_t ticksize)
 
void SetTimeFormat (const char *tformat)
 Change the format used for time plotting.
 
void SetTimeOffset (Double_t toffset, Option_t *option="local")
 Change the time offset. If option = "gmt", set display mode to GMT.
 
virtual void SetTitle (const char *title="")
 Change the title of the axis.
 
void SetTitleColor (Int_t titlecolor)
 
void SetTitleFont (Int_t titlefont)
 
void SetTitleOffset (Float_t titleoffset=1)
 
void SetTitleSize (Float_t titlesize)
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
void SetVertical (Bool_t set=kTRUE)
 Force the line to be drawn vertically.
 
void SetWmax (Double_t wmax)
 
void SetWmin (Double_t wmin)
 
virtual void SetX1 (Double_t x1)
 
virtual void SetX2 (Double_t x2)
 
virtual void SetY1 (Double_t y1)
 
virtual void SetY2 (Double_t y2)
 
void Streamer (TBuffer &) override
 Stream an object of class TGaxis.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Int_t GetMaxDigits ()
 Static function returning gStyle->GetAxisMaxDigits().
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetExponentOffset (Float_t xoff=0., Float_t yoff=0., Option_t *axis="xy")
 Static method to set X and Y offset of the axis 10^n notation.
 
static void SetMaxDigits (Int_t maxd=5)
 Static function to set fgMaxDigits for axis.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Types

enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 

Protected Member Functions

 TGaxis (const TGaxis &)
 Copy constructor.
 
void CleanupModLabs ()
 Correctly cleanup fModLabs - delete content when owned by TGaxis.
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
TAxisModLabFindModLab (Int_t indx, Int_t numlabels=0, Double_t v=0., Double_t eps=-1.) const
 Search for axis modifier by index or value.
 
Double_t GetXCoord (const Int_t x, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
 Return user X coordinate for pixel X value Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter x Used in derived classes to implement SetBBox... methods.
 
Double_t GetYCoord (const Int_t y, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
 Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter x.
 
Bool_t IsOwnedModLabs () const
 Returns kTRUE when fModLabs owned by TGaxis and should be cleaned up.
 
void MakeZombie ()
 
TGaxisoperator= (const TGaxis &)
 Assignment operator.
 

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
 
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
 
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.
 

Protected Attributes

TAxisfAxis
 ! Pointer to original TAxis axis (if any)
 
TString fChopt
 Axis options.
 
TF1fFunction
 ! Pointer to function computing axis values
 
TString fFunctionName
 Name of mapping function pointed by fFunction.
 
Float_t fGridLength
 Length of the grid in NDC.
 
Int_t fLabelColor
 Color for labels.
 
Int_t fLabelFont
 Font for labels.
 
Float_t fLabelOffset
 Offset of label wrt axis.
 
Float_t fLabelSize
 Size of labels in NDC.
 
Color_t fLineColor
 Line color.
 
Style_t fLineStyle
 Line style.
 
Width_t fLineWidth
 Line width.
 
TListfModLabs
 List of modified labels.
 
TString fName
 Axis name.
 
Int_t fNdiv
 Number of divisions.
 
Int_t fNModLabs
 Number of modified labels.
 
Short_t fTextAlign
 Text alignment.
 
Float_t fTextAngle
 Text angle.
 
Color_t fTextColor
 Text color.
 
Font_t fTextFont
 Text font.
 
Float_t fTextSize
 Text size.
 
Float_t fTickSize
 Size of primary tick mark in NDC.
 
TString fTimeFormat
 Time format, ex: 09/12/99 12:34:00.
 
TString fTitle
 Axis title.
 
Float_t fTitleOffset
 Offset of title wrt axis.
 
Float_t fTitleSize
 Size of title in NDC.
 
Double_t fWmax
 Highest value on the axis.
 
Double_t fWmin
 Lowest value on the axis.
 
Double_t fX1 {0}
 X of 1st point.
 
Double_t fX2 {0}
 X of 2nd point.
 
Double_t fY1 {0}
 Y of 1st point.
 
Double_t fY2 {0}
 Y of 2nd point.
 

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.
 

Private Attributes

UInt_t fBits
 bit field status word
 
UInt_t fUniqueID
 object unique identifier
 

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
 
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable
 

#include <TGaxis.h>

Inheritance diagram for TGaxis:
TLine TAttText TObject TAttLine TAttBBox2D

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kLineNDC 

Use NDC coordinates.

kVertical 

Line is vertical.

kHorizontal 

Line is horizontal.

Definition at line 32 of file TLine.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EStatusBits

Enumerator
kCanDelete 

if object in a list can be deleted

kMustCleanup 

if object destructor must call RecursiveRemove()

kIsReferenced 

if object is referenced by a TRef or TRefArray

kHasUUID 

if object has a TUUID (its fUniqueID=UUIDNumber)

kCannotPick 

if object in a pad cannot be picked

kNoContextMenu 

if object does not want context menu

kInvalidObject 

if object ctor succeeded but object should not be used

Definition at line 70 of file TObject.h.

Constructor & Destructor Documentation

◆ TGaxis() [1/4]

TGaxis::TGaxis ( const TGaxis & ax)
protected

Copy constructor.

Definition at line 795 of file TGaxis.cxx.

◆ TGaxis() [2/4]

TGaxis::TGaxis ( )

TGaxis default constructor.

Definition at line 693 of file TGaxis.cxx.

◆ TGaxis() [3/4]

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 721 of file TGaxis.cxx.

◆ TGaxis() [4/4]

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.

Note
The function func (with name funcname) is not defined in the user's coordinate space, but in the new TGaxis space. If x is the original axis, w the new axis, and w = f(x) (for example, f is a calibration function converting ADC channels x to energy w), then func must be supplied as f^{-1}(w).

Definition at line 758 of file TGaxis.cxx.

◆ ~TGaxis()

TGaxis::~TGaxis ( )
override

TGaxis default destructor.

Definition at line 860 of file TGaxis.cxx.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AdjustBinSize()

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 2508 of file TGaxis.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ Browse()

◆ CenterLabels()

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 895 of file TGaxis.cxx.

◆ CenterTitle()

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

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

Definition at line 905 of file TGaxis.cxx.

◆ ChangeLabel()

void TGaxis::ChangeLabel ( Int_t labNum = 0,
Double_t labAngle = -1.,
Double_t labSize = -1.,
Int_t labAlign = -1,
Int_t labColor = -1,
Int_t labFont = -1,
const TString & labText = "" )

Define new text attributes for the label number "labNum".

It allows to do a fine tuning of the labels. All the attributes can be changed, even the label text itself.

Parameters
[in]labNumNumber of the label to be changed, negative numbers start from the end
[in]labAngleNew angle value
[in]labSizeNew size (0 erase the label)
[in]labAlignNew alignment value
[in]labColorNew label color
[in]labFontNew label font
[in]labTextNew label text

Example:

{
auto c = new TCanvas("c1","Examples of TGaxis",900,100);
c->Range(-6,-0.1,6,0.1);
auto *axis = new TGaxis(-5.5,0.,5.5,0.,0.0,100,510,"S");
axis->SetName("axis1");
axis->SetTitle("Axis Title");
axis->SetTitleSize(0.2);
axis->SetLabelSize(0.2);
axis->SetTickSize(0.15);
axis->SetTitleColor(kBlue);
axis->SetTitleFont(42);
axis->ChangeLabel(1,-1,-1,-1,2);
axis->ChangeLabel(3,-1,0.);
axis->ChangeLabel(5,30.,-1,0);
axis->ChangeLabel(6,-1,-1,-1,3,-1,"6th label");
axis->ChangeLabel(-2,-1,-1,-1,3,-1,"2nd to last label");
axis->Draw();
}

Notes:

  • If an attribute should not be changed just give the value "-1".
  • If labnum=0 the list of modified labels is reset.
  • To erase a label set labSize to 0.
  • If labText is not specified or is an empty string, the text label is not changed.

Definition at line 2719 of file TGaxis.cxx.

◆ ChangeLabelAttributes()

void TGaxis::ChangeLabelAttributes ( Int_t i,
Int_t nlabels,
TLatex * t,
char * c,
Double_t value = 0.,
Double_t eps = -1. )

Helper method used by TGaxis::ChangeLabel.

Change the label attributes of label number i. If needed.

Parameters
[in]iCurrent label number to be changed if needed
[in]nlabelsTotals number of labels for this axis (useful when i is counted from the end)
[in]tOriginal TLatex string holding the label to be changed
[in]cText string to be drawn
[in]valueAxis value which should be changed
[in]epsEpsilon parameter for axis value, -1 means ignore axis value at all

Definition at line 2844 of file TGaxis.cxx.

◆ ChangeLabelByValue()

void TGaxis::ChangeLabelByValue ( Double_t labValue,
Double_t labAngle = -1.,
Double_t labSize = -1.,
Int_t labAlign = -1,
Int_t labColor = -1,
Int_t labFont = -1,
const TString & labText = "" )

Define new text attributes for the label value "labValue".

It allows to do a fine tuning of the labels. All the attributes can be changed, even the label text itself.

Parameters
[in]labValueAxis value to be changed
[in]labAngleNew angle value
[in]labSizeNew size (0 erase the label)
[in]labAlignNew alignment value
[in]labColorNew label color
[in]labFontNew label font
[in]labTextNew label text

Example:

{
auto c = new TCanvas("c1","Examples of TGaxis",900,100);
c->Range(-6,-0.1,6,0.1);
auto *axis = new TGaxis(-5.5,0.,5.5,0.,0.0,100,510,"S");
axis->SetName("axis1");
axis->SetTitle("Axis Title");
axis->SetTitleSize(0.2);
axis->SetLabelSize(0.2);
axis->SetTickSize(0.15);
axis->SetTitleColor(kBlue);
axis->SetTitleFont(42);
axis->ChangeLabelByValue(0., -1, -1, -1, kRed);
axis->ChangeLabelByValue(20., -1, 0);
axis->ChangeLabelByValue(40., 30.);
axis->ChangeLabelByValue(50., -1, -1, -1, kBlue, -1, "blue for 50.");
axis->ChangeLabelByValue(90., -1, -1, -1, kGreen, -1, "green for 90.");
axis->Draw();
}
@ kGreen
Definition Rtypes.h:67

Notes:

  • If an attribute should not be changed just give the value "-1".
  • To erase a label set labSize to 0
  • If labText is not specified or is an empty string, the text label is not changed.

Definition at line 2798 of file TGaxis.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ Class()

static TClass * TGaxis::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TGaxis::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TGaxis::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 140 of file TGaxis.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ CleanupModLabs()

void TGaxis::CleanupModLabs ( )
protected

Correctly cleanup fModLabs - delete content when owned by TGaxis.

Definition at line 880 of file TGaxis.cxx.

◆ Clear()

◆ Clone()

TObject * TObject::Clone ( const char * newname = "") const
virtualinherited

Make a clone of an object using the Streamer facility.

If the object derives from TNamed, this function is called by TNamed::Clone. TNamed::Clone uses the optional argument to set a new name to the newly created object.

If the object class has a DirectoryAutoAdd function, it will be called at the end of the function with the parameter gDirectory. This usually means that the object will be appended to the current ROOT directory.

Reimplemented in TMVA::MinuitWrapper, RooCatType, TImage, RooStudyPackage, RooLinkedList, RooStats::ModelConfig, TNamed, TCollection, TClass, TFunction, TFunctionTemplate, TMethod, TMethodCall, TASImage, TH1, TStreamerInfo, TMinuit, RooAbsStudy, RooDataHist, RooDataSet, RooWorkspace, TChainIndex, TTreeIndex, TF1, RooAbsArg, RooAbsBinning, RooAbsCollection, RooCmdArg, RooFitResult, RooTemplateProxy< T >, RooTemplateProxy< const RooHistFunc >, RooTemplateProxy< RooAbsCategory >, RooTemplateProxy< RooAbsPdf >, RooTemplateProxy< RooAbsReal >, RooTemplateProxy< RooAbsRealLValue >, RooTemplateProxy< RooMultiCategory >, RooTemplateProxy< RooRealVar >, and RooStats::HypoTestResult.

Definition at line 243 of file TObject.cxx.

◆ Compare()

Int_t TObject::Compare ( const TObject * obj) const
virtualinherited

Compare abstract method.

Must be overridden if a class wants to be able to compare itself with other objects. Must return -1 if this is smaller than obj, 0 if objects are equal and 1 if this is larger than obj.

Reimplemented in TEnvRec, TFileInfo, TNamed, TObjString, TParameter< AParamType >, TParameter< Long64_t >, TUrl, TCollection, TGeoBranchArray, TGeoOverlap, TStructNode, TStructNodeProperty, TGFSFrameElement, TGLBFrameElement, RooAbsArg, and RooDouble.

Definition at line 258 of file TObject.cxx.

◆ Copy() [1/3]

void TAttLine::Copy ( TAttLine & attline) const
inherited

Copy this line attributes to a new TAttLine.

Definition at line 176 of file TAttLine.cxx.

◆ Copy() [2/3]

void TAttText::Copy ( TAttText & atttext) const
inherited

Copy this text attributes to a new TAttText.

Definition at line 300 of file TAttText.cxx.

◆ Copy() [3/3]

void TLine::Copy ( TObject & line) const
overridevirtualinherited

Copy this line to line.

Reimplemented from TObject.

Definition at line 76 of file TLine.cxx.

◆ DeclFileName()

static const char * TGaxis::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 140 of file TGaxis.h.

◆ Delete()

void TObject::Delete ( Option_t * option = "")
virtualinherited

◆ DistancetoLine()

Int_t TAttLine::DistancetoLine ( Int_t px,
Int_t py,
Double_t xp1,
Double_t yp1,
Double_t xp2,
Double_t yp2 )
inherited

Compute distance from point px,py to a line.

Compute the closest distance of approach from point px,py to this line. The distance is computed in pixels units.

Algorithm:

A(x1,y1) P B(x2,y2)
-----------------+------------------------------
|
|
|
|
M(x,y)
Let us call a = distance AM A=a**2
b = distance BM B=b**2
c = distance AB C=c**2
d = distance PM D=d**2
u = distance AP U=u**2
v = distance BP V=v**2 c = u + v
D = A - U
D = B - V = B -(c-u)**2
==> u = (A -B +C)/2c
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100

Definition at line 210 of file TAttLine.cxx.

◆ DistancetoPrimitive()

Int_t TLine::DistancetoPrimitive ( Int_t px,
Int_t py )
overridevirtualinherited

Compute distance from point px,py to a line.

Reimplemented from TObject.

Definition at line 89 of file TLine.cxx.

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TTreeViewer, and TThread.

Definition at line 1059 of file TObject.cxx.

◆ Draw()

◆ DrawAxis()

TGaxis * 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 915 of file TGaxis.cxx.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TSystemDirectory, TSystemFile, and TGFrame.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TSystemDirectory, TSystemFile, TGFrame, TAxis, and TCanvas.

Definition at line 319 of file TObject.cxx.

◆ DrawLine()

TLine * TLine::DrawLine ( Double_t x1,
Double_t y1,
Double_t x2,
Double_t y2 )
virtualinherited

Draw this line with new coordinates.

Definition at line 103 of file TLine.cxx.

◆ DrawLineNDC()

TLine * TLine::DrawLineNDC ( Double_t x1,
Double_t y1,
Double_t x2,
Double_t y2 )
virtualinherited

Draw this line with new coordinates in NDC.

Definition at line 115 of file TLine.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fBits 50331648 bit field status word
fFillColor 19 fill area color
fFillStyle 1001 fill area style
#define X(type, name)
Option_t Option_t TPoint TPoint angle
Option_t Option_t width
Option_t Option_t style
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
Double_t fY1
Y of 1st point.
Definition TLine.h:26
Double_t fX1
X of 1st point.
Definition TLine.h:25
Double_t fX2
X of 2nd point.
Definition TLine.h:27
Double_t fY2
Y of 2nd point.
Definition TLine.h:28
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line

Reimplemented in TSystemFile, TCollection, TClass, TGFrame, and TGPack.

Definition at line 367 of file TObject.cxx.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in TMethodCall, TCling, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in TCling, TMethodCall, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

void TLine::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
overridevirtualinherited

Execute action corresponding to one event.

This member function is called when a line is clicked with the locator

If Left button clicked on one of the line end points, this point follows the cursor until button is released.

if Middle button clicked, the line is moved parallel to itself until the button is released.

Reimplemented from TObject.

Definition at line 132 of file TLine.cxx.

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ FindModLab()

TAxisModLab * TGaxis::FindModLab ( Int_t indx,
Int_t numlabels = 0,
Double_t v = 0.,
Double_t eps = -1. ) const
protected

Search for axis modifier by index or value.

Definition at line 2647 of file TGaxis.cxx.

◆ FindObject() [1/2]

TObject * TObject::FindObject ( const char * name) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object by name inside this object.

Reimplemented in TListOfEnums, TMap, TDirectory, TFolder, TROOT, TListOfTypes, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 425 of file TObject.cxx.

◆ FindObject() [2/2]

TObject * TObject::FindObject ( const TObject * obj) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object inside this object.

Reimplemented in TMap, TDirectory, TFolder, TROOT, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 435 of file TObject.cxx.

◆ GetBBox()

Rectangle_t TLine::GetBBox ( )
overridevirtualinherited

Return the bounding Box of the Line.

Implements TAttBBox2D.

Definition at line 489 of file TLine.cxx.

◆ GetBBoxCenter()

TPoint TAttBBox2D::GetBBoxCenter ( )
virtualinherited

Reimplemented in TPad, TCurlyArc, TEllipse, and TText.

Definition at line 40 of file TAttBBox2D.cxx.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetFunction()

TF1 * TGaxis::GetFunction ( ) const
inline

Definition at line 79 of file TGaxis.h.

◆ GetGridLength()

Float_t TGaxis::GetGridLength ( ) const
inline

Definition at line 78 of file TGaxis.h.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in TSystemFile, TGeoVolume, TASImage, TGMainFrame, TKey, ROOT::Experimental::XRooFit::xRooNode, TBranch, TVirtualBranchBrowsable, TMethodBrowsable, and TBranchElement.

Definition at line 472 of file TObject.cxx.

◆ GetLabelColor()

Int_t TGaxis::GetLabelColor ( ) const
inline

Definition at line 80 of file TGaxis.h.

◆ GetLabelFont()

Int_t TGaxis::GetLabelFont ( ) const
inline

Definition at line 81 of file TGaxis.h.

◆ GetLabelOffset()

Float_t TGaxis::GetLabelOffset ( ) const
inline

Definition at line 82 of file TGaxis.h.

◆ GetLabelSize()

Float_t TGaxis::GetLabelSize ( ) const
inline

Definition at line 83 of file TGaxis.h.

◆ GetLineColor()

virtual Color_t TAttLine::GetLineColor ( ) const
inlinevirtualinherited

Return the line color.

Reimplemented in TGraphMultiErrors, and TGWin32VirtualXProxy.

Definition at line 36 of file TAttLine.h.

◆ GetLineStyle()

virtual Style_t TAttLine::GetLineStyle ( ) const
inlinevirtualinherited

Return the line style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 37 of file TAttLine.h.

◆ GetLineWidth()

virtual Width_t TAttLine::GetLineWidth ( ) const
inlinevirtualinherited

Return the line width.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 38 of file TAttLine.h.

◆ GetMaxDigits()

Int_t TGaxis::GetMaxDigits ( )
static

Static function returning gStyle->GetAxisMaxDigits().

Definition at line 946 of file TGaxis.cxx.

◆ GetName()

const char * TGaxis::GetName ( ) const
inlineoverridevirtual

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 86 of file TGaxis.h.

◆ GetNdiv()

Int_t TGaxis::GetNdiv ( ) const
inline

Definition at line 90 of file TGaxis.h.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TGeoNode, TGeoVolume, TGeoTrack, TASImage, TColorWheel, TAxis3D, TNode, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TF1, TF2, TGraph, TH1, THistPainter, TPaletteAxis, TFileDrawMap, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

const char * TGaxis::GetOption ( ) const
inlineoverridevirtual

Reimplemented from TObject.

Definition at line 87 of file TGaxis.h.

◆ GetSlope()

Double_t TLine::GetSlope ( ) const
inherited

Get the slope of this TLine.

Definition at line 295 of file TLine.cxx.

◆ GetTextAlign()

virtual Short_t TAttText::GetTextAlign ( ) const
inlinevirtualinherited

Return the text alignment.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 35 of file TAttText.h.

◆ GetTextAngle()

virtual Float_t TAttText::GetTextAngle ( ) const
inlinevirtualinherited

Return the text angle.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 36 of file TAttText.h.

◆ GetTextColor()

virtual Color_t TAttText::GetTextColor ( ) const
inlinevirtualinherited

Return the text color.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 37 of file TAttText.h.

◆ GetTextFont()

virtual Font_t TAttText::GetTextFont ( ) const
inlinevirtualinherited

Return the text font.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 38 of file TAttText.h.

◆ GetTextSize()

virtual Float_t TAttText::GetTextSize ( ) const
inlinevirtualinherited

Return the text size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 39 of file TAttText.h.

◆ GetTextSizePercent()

Float_t TAttText::GetTextSizePercent ( Float_t size)
virtualinherited

Return the text in percent of the pad size.

Return the text size in percent of the pad size.

If the font precision is greater than 2, the text size returned is the size in pixel converted into percent of the pad size, otherwise the size returned is the same as the size given as input parameter.

Definition at line 316 of file TAttText.cxx.

◆ GetTextSizePixels()

Float_t TAttText::GetTextSizePixels ( TVirtualPad & pad) const
virtualinherited

Return the text size in pixels for specified pad.

Return the text size in pixels for the specified pad.

If the font precision less than 3 size defined as percent of pad size and scaled to minimal pad size

Definition at line 350 of file TAttText.cxx.

◆ GetTextSizeRelative()

Float_t TAttText::GetTextSizeRelative ( TVirtualPad & pad) const
virtualinherited

Return the text size in relative units.

If the font precision grater then 2 use pad dimensions to get value

Definition at line 333 of file TAttText.cxx.

◆ GetTickSize()

Float_t TGaxis::GetTickSize ( ) const
inline

Definition at line 93 of file TGaxis.h.

◆ GetTitle()

const char * TGaxis::GetTitle ( ) const
inlineoverridevirtual

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 88 of file TGaxis.h.

◆ GetTitleOffset()

Float_t TGaxis::GetTitleOffset ( ) const
inline

Definition at line 84 of file TGaxis.h.

◆ GetTitleSize()

Float_t TGaxis::GetTitleSize ( ) const
inline

Definition at line 85 of file TGaxis.h.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetWmax()

Double_t TGaxis::GetWmax ( ) const
inline

Definition at line 92 of file TGaxis.h.

◆ GetWmin()

Double_t TGaxis::GetWmin ( ) const
inline

Definition at line 91 of file TGaxis.h.

◆ GetX1()

Double_t TLine::GetX1 ( ) const
inlineinherited

Definition at line 50 of file TLine.h.

◆ GetX2()

Double_t TLine::GetX2 ( ) const
inlineinherited

Definition at line 51 of file TLine.h.

◆ GetXCoord()

Double_t TAttBBox2D::GetXCoord ( const Int_t x,
Bool_t is_ndc = kFALSE,
Bool_t is_absolute = kFALSE )
protectedinherited

Return user X coordinate for pixel X value Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter x Used in derived classes to implement SetBBox... methods.

Definition at line 62 of file TAttBBox2D.cxx.

◆ GetY1()

Double_t TLine::GetY1 ( ) const
inlineinherited

Definition at line 52 of file TLine.h.

◆ GetY2()

Double_t TLine::GetY2 ( ) const
inlineinherited

Definition at line 53 of file TLine.h.

◆ GetYCoord()

Double_t TAttBBox2D::GetYCoord ( const Int_t y,
Bool_t is_ndc = kFALSE,
Bool_t is_absolute = kFALSE )
protectedinherited

Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter x.

Definition at line 85 of file TAttBBox2D.cxx.

◆ GetYIntercept()

Double_t TLine::GetYIntercept ( ) const
inherited

Get the Y-Intercept of this TLine.

Definition at line 310 of file TLine.cxx.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGWindow, TGuiBldDragManager, TGraphTime, TGLEventHandler, TGCommandPlugin, TGDNDManager, TGFileContainer, TGPopupMenu, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGHtml, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TObject::Hash ( ) const
virtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
virtual ULong_t Hash() const
Return hash value for this object.
Definition TObject.cxx:539
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented in TEnvRec, TNamed, TObjString, TParameter< AParamType >, TParameter< Long64_t >, TCollection, TPair, TASImagePlugin, TASPluginGS, TPad, TImagePlugin, TPave, TGObject, TGPicture, TIconBoxThumb, TStatistic, and RooLinkedList.

Definition at line 539 of file TObject.cxx.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ ImportAxisAttributes()

void TGaxis::ImportAxisAttributes ( TAxis * axis)
virtual

Internal method to import TAxis attributes to this TGaxis.

Definition at line 954 of file TGaxis.cxx.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in TSystemFile, TInspectorObject, TGFrame, and ROOT::Experimental::XRooFit::xRooNode.

Definition at line 570 of file TObject.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TGaxis::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 140 of file TGaxis.h.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TObjString, TQCommand, TPair, and TGObject.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

◆ IsHorizontal()

Bool_t TLine::IsHorizontal ( )
inherited

Check whether this line is to be drawn horizontally.

Definition at line 397 of file TLine.cxx.

◆ IsOnHeap()

R__ALWAYS_INLINE Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsOwnedModLabs()

Bool_t TGaxis::IsOwnedModLabs ( ) const
protected

Returns kTRUE when fModLabs owned by TGaxis and should be cleaned up.

Definition at line 868 of file TGaxis.cxx.

◆ IsSortable()

◆ IsVertical()

Bool_t TLine::IsVertical ( )
inherited

Check whether this line is to be drawn vertically.

Definition at line 405 of file TLine.cxx.

◆ IsZombie()

R__ALWAYS_INLINE Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ LabelsLimits()

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 2543 of file TGaxis.cxx.

◆ ls()

void TLine::ls ( Option_t * option = "") const
overridevirtualinherited

List this line with its attributes.

Reimplemented from TObject.

Definition at line 325 of file TLine.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

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

Definition at line 1160 of file TObject.cxx.

◆ Modify() [1/2]

void TAttLine::Modify ( )
virtualinherited

Change current line attributes if necessary.

Definition at line 246 of file TAttLine.cxx.

◆ Modify() [2/2]

void TAttText::Modify ( )
virtualinherited

Change current text attributes if necessary.

Definition at line 364 of file TAttText.cxx.

◆ ModifyOn() [1/2]

void TAttLine::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current line attributes on specified pad.

Definition at line 255 of file TAttLine.cxx.

◆ ModifyOn() [2/2]

void TAttText::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current text attributes if necessary on specified pad.

Definition at line 373 of file TAttText.cxx.

◆ Notify()

Bool_t TObject::Notify ( )
virtualinherited

This method must be overridden to handle object notification (the base implementation is no-op).

Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.

For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.

Reimplemented in TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TFileHandler, TSignalHandler, TStdExceptionHandler, TProcessEventTimer, TTimer, TIdleTimer, TSingleShotCleaner, TCollection, TRefTable, TBrowserTimer, TInterruptHandler, TTermInputHandler, TThreadTimer, TGLRedrawTimer, TViewTimer, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TViewUpdateTimer, TPopupDelayTimer, TRepeatTimer, TSBRepeatTimer, TGTextEditHist, TInsCharCom, TDelCharCom, TBreakLineCom, TInsTextCom, TDelTextCom, TBlinkTimer, TTipDelayTimer, TGuiBldDragManagerRepeatTimer, TARInterruptHandler, TASLogHandler, TASInterruptHandler, TASSigPipeHandler, TASInputHandler, TSocketHandler, TTimeOutTimer, TBranchElement, TBranchRef, TLeafObject, TSelector, TTree, TSelectorDraw, TSelectorEntries, TTreeFormula, TTreeFormulaManager, TTreeReader, h1analysis, h1analysisTreeReader, and TSysEvtHandler.

Definition at line 618 of file TObject.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ operator=()

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

Assignment operator.

Definition at line 827 of file TGaxis.cxx.

◆ Paint()

void TGaxis::Paint ( Option_t * chopt = "")
overridevirtual

Draw this axis with its current attributes.

Reimplemented from TObject.

Definition at line 985 of file TGaxis.cxx.

◆ PaintAxis()

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 1007 of file TGaxis.cxx.

◆ PaintLine()

void TLine::PaintLine ( Double_t x1,
Double_t y1,
Double_t x2,
Double_t y2 )
virtualinherited

Draw this line with new coordinates.

Definition at line 344 of file TLine.cxx.

◆ PaintLineNDC()

void TLine::PaintLineNDC ( Double_t u1,
Double_t v1,
Double_t u2,
Double_t v2 )
virtualinherited

Draw this line with new coordinates in NDC.

Definition at line 354 of file TLine.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TPad, TFrame, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print()

void TLine::Print ( Option_t * option = "") const
overridevirtualinherited

Dump this line with its attributes.

Reimplemented from TObject.

Definition at line 364 of file TLine.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TKeyXML, TBuffer, TKey, and TKeySQL.

Definition at line 673 of file TObject.cxx.

◆ RecursiveRemove()

◆ ResetAttLine()

void TAttLine::ResetAttLine ( Option_t * option = "")
virtualinherited

Reset this line attributes to default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 279 of file TAttLine.cxx.

◆ ResetAttText()

void TAttText::ResetAttText ( Option_t * toption = "")
virtualinherited

Reset this text attributes to default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 387 of file TAttText.cxx.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ ResetLabelAttributes()

void TGaxis::ResetLabelAttributes ( TLatex * t)

Helper method used by TGaxis::ChangeLabel.

Reset the labels' attributes to the values they had before the last call to TGaxis::ChangeLabelAttributes.

Definition at line 2865 of file TGaxis.cxx.

◆ Rotate()

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 2555 of file TGaxis.cxx.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in TSpline, TFolder, TGeoVolume, TClassTree, TPad, TPaveClass, TGObject, TSpline3, TSpline5, ROOT::Experimental::XRooFit::xRooNode, TTreePerfStats, TVirtualPad, TGraph, and TH1.

Definition at line 708 of file TObject.cxx.

◆ SaveLineAttributes()

void TAttLine::SaveLineAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t widdef = 1 )
virtualinherited

Save line attributes as C++ statement(s) on output stream out.

Definition at line 289 of file TAttLine.cxx.

◆ SavePrimitive()

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

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

Reimplemented from TObject.

Definition at line 2565 of file TGaxis.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ SaveTextAttributes()

void TAttText::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 )
virtualinherited

Save text attributes as C++ statement(s) on output stream out.

Definition at line 399 of file TAttText.cxx.

◆ SetBBoxCenter()

void TAttBBox2D::SetBBoxCenter ( const TPoint & p)
virtualinherited

Reimplemented in TPad.

Definition at line 50 of file TAttBBox2D.cxx.

◆ SetBBoxCenterX()

void TLine::SetBBoxCenterX ( const Int_t x)
overridevirtualinherited

Set X coordinate of the center of the BoundingBox.

Implements TAttBBox2D.

Definition at line 514 of file TLine.cxx.

◆ SetBBoxCenterY()

void TLine::SetBBoxCenterY ( const Int_t y)
overridevirtualinherited

Set Y coordinate of the center of the BoundingBox.

Implements TAttBBox2D.

Definition at line 525 of file TLine.cxx.

◆ SetBBoxX1()

void TLine::SetBBoxX1 ( const Int_t x)
overridevirtualinherited

Set left hand side of BoundingBox to a value (resize in x direction on left)

Implements TAttBBox2D.

Definition at line 537 of file TLine.cxx.

◆ SetBBoxX2()

void TLine::SetBBoxX2 ( const Int_t x)
overridevirtualinherited

Set right hand side of BoundingBox to a value (resize in x direction on right)

Implements TAttBBox2D.

Definition at line 550 of file TLine.cxx.

◆ SetBBoxY1()

void TLine::SetBBoxY1 ( const Int_t y)
overridevirtualinherited

Set top of BoundingBox to a value (resize in y direction on top)

Implements TAttBBox2D.

Definition at line 562 of file TLine.cxx.

◆ SetBBoxY2()

void TLine::SetBBoxY2 ( const Int_t y)
overridevirtualinherited

Set bottom of BoundingBox to a value (resize in y direction on bottom)

Implements TAttBBox2D.

Definition at line 575 of file TLine.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetDecimals()

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 2619 of file TGaxis.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in TSystemDirectory, TSystemFile, TPad, TGFrame, TAxis, TBrowser, TPaveStats, TGedFrame, TRootBrowserLite, and RooPlot.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetExponentOffset()

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

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

It applies on axis belonging to an histogram (TAxis). It has no effect on standalone TGaxis. 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 Redirected to TStyle::SetExponentOffset

Definition at line 3020 of file TGaxis.cxx.

◆ SetFunction()

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

Specify a function to map the axis values.

Definition at line 2628 of file TGaxis.cxx.

◆ SetGridLength()

void TGaxis::SetGridLength ( Float_t gridlength)
inline

Definition at line 126 of file TGaxis.h.

◆ SetHorizontal()

void TLine::SetHorizontal ( Bool_t set = kTRUE)
inherited

Force the line to be drawn horizontally.

Makes fY2 equal to fY1. The line length is kept. TArrow and TGaxis also get this function by inheritance.

Definition at line 423 of file TLine.cxx.

◆ SetLabelColor() [1/2]

void TGaxis::SetLabelColor ( Int_t labelcolor)
inline

Definition at line 106 of file TGaxis.h.

◆ SetLabelColor() [2/2]

void TGaxis::SetLabelColor ( TColorNumber lcolor)

Definition at line 3069 of file TGaxis.cxx.

◆ SetLabelFont()

void TGaxis::SetLabelFont ( Int_t labelfont)
inline

Definition at line 107 of file TGaxis.h.

◆ SetLabelOffset()

void TGaxis::SetLabelOffset ( Float_t labeloffset)
inline

Definition at line 108 of file TGaxis.h.

◆ SetLabelSize()

void TGaxis::SetLabelSize ( Float_t labelsize)
inline

Definition at line 109 of file TGaxis.h.

◆ SetLineAttributes()

void TAttLine::SetLineAttributes ( )
virtualinherited

Invoke the DialogCanvas Line attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 306 of file TAttLine.cxx.

◆ SetLineColor() [1/2]

◆ SetLineColor() [2/2]

void TAttLine::SetLineColor ( TColorNumber lcolor)
inherited

Definition at line 322 of file TAttLine.cxx.

◆ SetLineColorAlpha()

void TAttLine::SetLineColorAlpha ( Color_t lcolor,
Float_t lalpha )
virtualinherited

Set a transparent line color.

Parameters
lcolordefines the line color
lalphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
lalpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Reimplemented in TGraphMultiErrors.

Definition at line 317 of file TAttLine.cxx.

◆ SetLineStyle()

virtual void TAttLine::SetLineStyle ( Style_t lstyle)
inlinevirtualinherited

◆ SetLineWidth()

◆ SetMaxDigits()

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. Warning: this static function changes the max number of digits in all axes. If you only want to change the digits of the current TGaxis instance, use axis->SetNdivisions(N*1000000 + (axis->GetNdiv()%1000000)) instead of axis->SetMaxDigits(N).

Definition at line 2881 of file TGaxis.cxx.

◆ SetMoreLogLabels()

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 2899 of file TGaxis.cxx.

◆ SetName()

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

Change the name of the axis.

Definition at line 2889 of file TGaxis.cxx.

◆ SetNDC()

void TLine::SetNDC ( Bool_t isNDC = kTRUE)
virtualinherited

Set NDC mode on if isNDC = kTRUE, off otherwise.

Definition at line 413 of file TLine.cxx.

◆ SetNdivisions()

virtual void TGaxis::SetNdivisions ( Int_t ndiv)
inlinevirtual

Definition at line 120 of file TGaxis.h.

◆ SetNoExponent()

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 2910 of file TGaxis.cxx.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetOption()

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

To set axis options.

Definition at line 2919 of file TGaxis.cxx.

◆ SetTextAlign()

virtual void TAttText::SetTextAlign ( Short_t align = 11)
inlinevirtualinherited

Set the text alignment.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 48 of file TAttText.h.

◆ SetTextAngle()

virtual void TAttText::SetTextAngle ( Float_t tangle = 0)
inlinevirtualinherited

Set the text angle.

Reimplemented in TGWin32VirtualXProxy, and TGraphNode.

Definition at line 49 of file TAttText.h.

◆ SetTextAttributes()

void TAttText::SetTextAttributes ( )
virtualinherited

Invoke the DialogCanvas Text attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 418 of file TAttText.cxx.

◆ SetTextColor() [1/2]

virtual void TAttText::SetTextColor ( Color_t tcolor = 1)
inlinevirtualinherited

Set the text color.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, TPDF, TPostScript, TSVG, TTeXDump, and TGWin32VirtualXProxy.

Definition at line 50 of file TAttText.h.

◆ SetTextColor() [2/2]

void TAttText::SetTextColor ( TColorNumber lcolor)
inherited

Definition at line 453 of file TAttText.cxx.

◆ SetTextColorAlpha()

void TAttText::SetTextColorAlpha ( Color_t tcolor,
Float_t talpha )
virtualinherited

Set a transparent text color.

Parameters
tcolordefines the text color
talphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
talpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Definition at line 430 of file TAttText.cxx.

◆ SetTextFont()

virtual void TAttText::SetTextFont ( Font_t tfont = 62)
inlinevirtualinherited

Set the text font.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, and TGWin32VirtualXProxy.

Definition at line 52 of file TAttText.h.

◆ SetTextSize()

virtual void TAttText::SetTextSize ( Float_t tsize = 1)
inlinevirtualinherited

Set the text size.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, and TGWin32VirtualXProxy.

Definition at line 53 of file TAttText.h.

◆ SetTextSizePixels()

void TAttText::SetTextSizePixels ( Int_t npixels)
virtualinherited

Set the text size in pixel.

Set the text size in pixels.

If the font precision is greater than 2, the text size is set to npixels, otherwise the text size is computed as a percent of the pad size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 441 of file TAttText.cxx.

◆ SetTickLength()

void TGaxis::SetTickLength ( Float_t ticklength)
inline

Definition at line 125 of file TGaxis.h.

◆ SetTickSize()

void TGaxis::SetTickSize ( Float_t ticksize)
inline

Definition at line 124 of file TGaxis.h.

◆ SetTimeFormat()

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 2954 of file TGaxis.cxx.

◆ SetTimeOffset()

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 2978 of file TGaxis.cxx.

◆ SetTitle()

void TGaxis::SetTitle ( const char * title = "")
virtual

Change the title of the axis.

Definition at line 2927 of file TGaxis.cxx.

◆ SetTitleColor()

void TGaxis::SetTitleColor ( Int_t titlecolor)
inline

Definition at line 133 of file TGaxis.h.

◆ SetTitleFont()

void TGaxis::SetTitleFont ( Int_t titlefont)
inline

Definition at line 132 of file TGaxis.h.

◆ SetTitleOffset()

void TGaxis::SetTitleOffset ( Float_t titleoffset = 1)
inline

Definition at line 130 of file TGaxis.h.

◆ SetTitleSize()

void TGaxis::SetTitleSize ( Float_t titlesize)
inline

Definition at line 131 of file TGaxis.h.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ SetVertical()

void TLine::SetVertical ( Bool_t set = kTRUE)
inherited

Force the line to be drawn vertically.

Makes fX2 equal to fX1. The line length is kept. TArrow and TGaxis also get this function by inheritance.

Definition at line 444 of file TLine.cxx.

◆ SetWmax()

void TGaxis::SetWmax ( Double_t wmax)
inline

Definition at line 135 of file TGaxis.h.

◆ SetWmin()

void TGaxis::SetWmin ( Double_t wmin)
inline

Definition at line 134 of file TGaxis.h.

◆ SetX1()

virtual void TLine::SetX1 ( Double_t x1)
inlinevirtualinherited

Definition at line 67 of file TLine.h.

◆ SetX2()

virtual void TLine::SetX2 ( Double_t x2)
inlinevirtualinherited

Definition at line 68 of file TLine.h.

◆ SetY1()

virtual void TLine::SetY1 ( Double_t y1)
inlinevirtualinherited

Definition at line 69 of file TLine.h.

◆ SetY2()

virtual void TLine::SetY2 ( Double_t y2)
inlinevirtualinherited

Definition at line 70 of file TLine.h.

◆ Streamer()

void TGaxis::Streamer ( TBuffer & R__b)
overridevirtual

Stream an object of class TGaxis.

Reimplemented from TObject.

Definition at line 3028 of file TGaxis.cxx.

◆ StreamerNVirtual()

void TGaxis::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 140 of file TGaxis.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

R__ALWAYS_INLINE Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UseCurrentStyle()

void TObject::UseCurrentStyle ( )
virtualinherited

Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.

Reimplemented in TCanvas, TPad, TFrame, TPaveStats, TPaveText, TAxis3D, TGraph, TH1, and TTree.

Definition at line 909 of file TObject.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
virtualinherited

Write this object to the current directory.

For more see the const version of this method.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, ROOT::TBufferMergerFile, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 989 of file TObject.cxx.

◆ Write() [2/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
virtualinherited

Write this object to the current directory.

The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".

Writing an object to a file involves the following steps:

  • Creation of a support TKey object in the current directory. The TKey object creates a TBuffer object.
  • The TBuffer object is filled via the class::Streamer function.
  • If the file is compressed (default) a second buffer is created to hold the compressed buffer.
  • Reservation of the corresponding space in the file by looking in the TFree list of free blocks of the file.
  • The buffer is written to the file.

Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.

If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().

The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.

An object is read from the file into memory via TKey::Read() or via TObject::Read().

The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 964 of file TObject.cxx.

Member Data Documentation

◆ fAxis

TAxis* TGaxis::fAxis
protected

! Pointer to original TAxis axis (if any)

Definition at line 48 of file TGaxis.h.

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fChopt

TString TGaxis::fChopt
protected

Axis options.

Definition at line 42 of file TGaxis.h.

◆ fFunction

TF1* TGaxis::fFunction
protected

! Pointer to function computing axis values

Definition at line 47 of file TGaxis.h.

◆ fFunctionName

TString TGaxis::fFunctionName
protected

Name of mapping function pointed by fFunction.

Definition at line 46 of file TGaxis.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fGridLength

Float_t TGaxis::fGridLength
protected

Length of the grid in NDC.

Definition at line 32 of file TGaxis.h.

◆ fLabelColor

Int_t TGaxis::fLabelColor
protected

Color for labels.

Definition at line 39 of file TGaxis.h.

◆ fLabelFont

Int_t TGaxis::fLabelFont
protected

Font for labels.

Definition at line 40 of file TGaxis.h.

◆ fLabelOffset

Float_t TGaxis::fLabelOffset
protected

Offset of label wrt axis.

Definition at line 34 of file TGaxis.h.

◆ fLabelSize

Float_t TGaxis::fLabelSize
protected

Size of labels in NDC.

Definition at line 35 of file TGaxis.h.

◆ fLineColor

Color_t TAttLine::fLineColor
protectedinherited

Line color.

Definition at line 24 of file TAttLine.h.

◆ fLineStyle

Style_t TAttLine::fLineStyle
protectedinherited

Line style.

Definition at line 25 of file TAttLine.h.

◆ fLineWidth

Width_t TAttLine::fLineWidth
protectedinherited

Line width.

Definition at line 26 of file TAttLine.h.

◆ fModLabs

TList* TGaxis::fModLabs
protected

List of modified labels.

Definition at line 49 of file TGaxis.h.

◆ fName

TString TGaxis::fName
protected

Axis name.

Definition at line 43 of file TGaxis.h.

◆ fNdiv

Int_t TGaxis::fNdiv
protected

Number of divisions.

Definition at line 38 of file TGaxis.h.

◆ fNModLabs

Int_t TGaxis::fNModLabs
protected

Number of modified labels.

Definition at line 41 of file TGaxis.h.

◆ fTextAlign

Short_t TAttText::fTextAlign
protectedinherited

Text alignment.

Definition at line 26 of file TAttText.h.

◆ fTextAngle

Float_t TAttText::fTextAngle
protectedinherited

Text angle.

Definition at line 24 of file TAttText.h.

◆ fTextColor

Color_t TAttText::fTextColor
protectedinherited

Text color.

Definition at line 27 of file TAttText.h.

◆ fTextFont

Font_t TAttText::fTextFont
protectedinherited

Text font.

Definition at line 28 of file TAttText.h.

◆ fTextSize

Float_t TAttText::fTextSize
protectedinherited

Text size.

Definition at line 25 of file TAttText.h.

◆ fTickSize

Float_t TGaxis::fTickSize
protected

Size of primary tick mark in NDC.

Definition at line 33 of file TGaxis.h.

◆ fTimeFormat

TString TGaxis::fTimeFormat
protected

Time format, ex: 09/12/99 12:34:00.

Definition at line 45 of file TGaxis.h.

◆ fTitle

TString TGaxis::fTitle
protected

Axis title.

Definition at line 44 of file TGaxis.h.

◆ fTitleOffset

Float_t TGaxis::fTitleOffset
protected

Offset of title wrt axis.

Definition at line 36 of file TGaxis.h.

◆ fTitleSize

Float_t TGaxis::fTitleSize
protected

Size of title in NDC.

Definition at line 37 of file TGaxis.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.

◆ fWmax

Double_t TGaxis::fWmax
protected

Highest value on the axis.

Definition at line 31 of file TGaxis.h.

◆ fWmin

Double_t TGaxis::fWmin
protected

Lowest value on the axis.

Definition at line 30 of file TGaxis.h.

◆ fX1

Double_t TLine::fX1 {0}
protectedinherited

X of 1st point.

Definition at line 25 of file TLine.h.

◆ fX2

Double_t TLine::fX2 {0}
protectedinherited

X of 2nd point.

Definition at line 27 of file TLine.h.

◆ fY1

Double_t TLine::fY1 {0}
protectedinherited

Y of 1st point.

Definition at line 26 of file TLine.h.

◆ fY2

Double_t TLine::fY2 {0}
protectedinherited

Y of 2nd point.

Definition at line 28 of file TLine.h.


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