Example illustrating how to modify individual labels of a TGaxis.
The method ChangeLabel
allows to do that.
The first parameter of this method is the label number to be modified. If this number is negative labels are numbered from the last one. The other parameters are (in order):
- the new angle value,
- the new size (0 erase the label),
- the new text alignment,
- the new label color, = the new label text.
void gaxis3() {
c1->Range(-6,-0.1,6,0.1);
axis->
ChangeLabel(-2,-1,-1,-1,3,-1,
"2nd to last label");
}
void SetTitleSize(Float_t titlesize)
void SetTitleFont(Int_t titlefont)
virtual void SetTitle(const char *title="")
Change the title of the axis.
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, TString labText="")
Define new text attributes for the label number "labNum".
void SetTitleColor(Int_t titlecolor)
virtual void SetName(const char *name)
Change the name of the axis.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
- Author
- Olivier Couet
Definition in file gaxis3.C.