gaxis.C

Go to the documentation of this file.
00001 {
00002 //Simple example illustrating how to draw TGaxis objects in various formats.    
00003 //To see the output of this macro, click begin_html <a href="gif/gaxis.gif" >here</a> end_html
00004 //Author: Rene Brun
00005 
00006   gROOT.Reset();
00007 
00008   c1 = new TCanvas("c1","Examples of Gaxis",10,10,700,500);
00009 
00010   c1->Range(-10,-1,10,1);
00011 
00012   TGaxis *axis1 = new TGaxis(-4.5,-0.2,5.5,-0.2,-6,8,510,"");
00013   axis1->SetName("axis1");
00014   axis1->Draw();
00015 
00016   TGaxis *axis2 = new TGaxis(-4.5,0.2,5.5,0.2,0.001,10000,510,"G");
00017   axis2->SetName("axis2");
00018   axis2->Draw();
00019 
00020   TGaxis *axis3 = new TGaxis(-9,-0.8,-9,0.8,-8,8,50510,"");
00021   axis3->SetName("axis3");
00022   axis3->SetTitle("axis3");
00023   axis3->SetTitleOffset(0.5);
00024   axis3->Draw();
00025 
00026   TGaxis *axis4 = new TGaxis(-7,-0.8,-7,0.8,1,10000,50510,"G");
00027   axis4->SetName("axis4");
00028   axis4->SetTitle("axis4");
00029   axis4->Draw();
00030    
00031   TGaxis *axis5 = new TGaxis(-4.5,-0.6,5.5,-0.6,1.2,1.32,80506,"-+");
00032   axis5->SetName("axis5");
00033   axis5->SetLabelSize(0.03);
00034   axis5->SetTextFont(72);
00035 
00036   axis5->Draw();
00037 
00038   TGaxis *axis6 = new TGaxis(-4.5,0.5,5.5,0.5,100,900,50510,"-");
00039   axis6->SetName("axis6");
00040   axis6->Draw();
00041   TGaxis *axis6a = new TGaxis(-5.5,0.85,5.5,0.85,0,4.3e-6,510,"");
00042   axis6a->SetName("axis6a");
00043   axis6a->Draw();
00044 
00045   TGaxis *axis7 = new TGaxis(8,-0.8,8,0.8,0,9000,50510,"+L");
00046   axis7->SetName("axis7");
00047   axis7->Draw();
00048 
00049   //one can make axis going top->bottom. However because of a long standing
00050   //problem, the two x values should not be equal
00051   TGaxis *axis8 = new TGaxis(6.5,0.8,6.499,-0.8,0,90,50510,"-");
00052   axis8->SetName("axis8");
00053   axis8->Draw();
00054 }

Generated on Tue Jul 5 15:44:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1