Logo ROOT   6.14/05
Reference Guide
Variables
TGaxis.cxx File Reference
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "Riostream.h"
#include "TROOT.h"
#include "TGaxis.h"
#include "TAxisModLab.h"
#include "TVirtualPad.h"
#include "TVirtualX.h"
#include "TLine.h"
#include "TLatex.h"
#include "TStyle.h"
#include "TF1.h"
#include "TAxis.h"
#include "THashList.h"
#include "TObjString.h"
#include "TObject.h"
#include "TMath.h"
#include "THLimitsFinder.h"
#include "TColor.h"
#include "TClass.h"
#include "TTimeStamp.h"
#include "TSystem.h"
Include dependency graph for TGaxis.cxx:

Variables

const Int_t kHori = BIT(9)
 
static Int_t SavedTextAlign
 
static Int_t SavedTextColor
 
static Int_t SavedTextFont
 
static Double_t SavedTextSize
 
image html pict1_TGaxis_012 png width
 Define new text attributes for the label number "labNum". More...
 

Variable Documentation

◆ kHori

const Int_t kHori = BIT(9)

Definition at line 44 of file TGaxis.cxx.

◆ SavedTextAlign

Int_t SavedTextAlign
static

Definition at line 2592 of file TGaxis.cxx.

◆ SavedTextColor

Int_t SavedTextColor
static

Definition at line 2593 of file TGaxis.cxx.

◆ SavedTextFont

Int_t SavedTextFont
static

Definition at line 2594 of file TGaxis.cxx.

◆ SavedTextSize

Double_t SavedTextSize
static

Definition at line 2591 of file TGaxis.cxx.

◆ width

image html pict1_TGaxis_012 png width

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

If an attribute should not be changed just give the value "-1".The following macro gives an example:

{
c1 = new TCanvas("c1","Examples of Gaxis",10,10,900,500);
c1->Range(-6,-0.1,6,0.1);
TGaxis *axis1 = new TGaxis(-5.5,0.,5.5,0.,0.0,100,510,"");
axis1->SetName("axis1");
axis1->SetTitle("Axis Title");
axis1->SetTitleSize(0.05);
axis1->SetTitleFont(42);
axis1->ChangeLabel(1,-1,-1,-1,2);
axis1->ChangeLabel(3,-1,0.);
axis1->ChangeLabel(5,30.,-1,0);
axis1->ChangeLabel(6,-1,-1,-1,3,-1,"6th label");
axis1->ChangeLabel(-2,-1,-1,-1,3,-1,"2nd to last label");
axis1->Draw();
}

Definition at line 2551 of file TGaxis.cxx.