Logo ROOT   6.08/07
Reference Guide
manyaxis.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// \notebook -js
4 /// Show several TGaxis formats.
5 ///
6 /// \macro_image
7 /// \macro_code
8 ///
9 /// \author Olivier Couet
10 
11 void manyaxis()
12 {
13  c1 = new TCanvas("c1","Examples of Gaxis",10,10,700,500);
14 
15  c1->Range(-10,-1,10,1);
16 
17  TGaxis *axis1 = new TGaxis(-5,-0.2,6,-0.2,-6,8,510,"");
18  axis1->SetName("axis1");
19  axis1->Draw();
20 
21  TGaxis *axis2 = new TGaxis(-5,0.2,6,0.2,0.001,10000,510,"G");
22  axis2->SetName("axis2");
23  axis2->Draw();
24 
25  TGaxis *axis3 = new TGaxis(-9,-0.8,-9,0.8,-8,8,50510,"");
26  axis3->SetName("axis3");
27  axis3->Draw();
28 
29  TGaxis *axis4 = new TGaxis(-7,-0.8,-7,0.8,1,10000,50510,"G");
30  axis4->SetName("axis4");
31  axis4->Draw();
32 
33  TGaxis *axis5 = new TGaxis(-5,-0.6,6,-0.6,1.2,1.32,80506,"-+");
34  axis5->SetName("axis5");
35  axis5->SetLabelSize(0.03);
36  axis5->SetTextFont(72);
37  axis5->SetLabelOffset(0.025);
38 
39  axis5->Draw();
40 
41  TGaxis *axis6 = new TGaxis(-5,0.6,6,0.6,100,900,50510,"-");
42  axis6->SetName("axis6");
43  axis6->Draw();
44 
45  TGaxis *axis7 = new TGaxis(8,-0.8,8,0.8,0,9000,50510,"+L");
46  axis7->SetName("axis7");
47  axis7->SetLabelOffset(0.01);
48  axis7->Draw();
49 }
virtual void SetName(const char *name)
Change the name of the axis.
Definition: TGaxis.cxx:2393
return c1
Definition: legend1.C:41
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:255
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition: TAttText.h:51
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:114
The axis painter class.
Definition: TGaxis.h:30
The Canvas class.
Definition: TCanvas.h:41
void SetLabelOffset(Float_t labeloffset)
Definition: TGaxis.h:113