Logo ROOT  
Reference Guide
zones.C File Reference

Detailed Description

View in nbviewer Open in SWAN Example of script showing how to divide a canvas into adjacent subpads + axis labels on the top and right side of the pads.

void zones() {
TCanvas *c1 = new TCanvas("c1","multipads",900,700);
c1->Divide(2,2,0,0);
TH2F *h1 = new TH2F("h1","test1",10,0,1,20,0,20);
TH2F *h2 = new TH2F("h2","test2",10,0,1,20,0,100);
TH2F *h3 = new TH2F("h3","test3",10,0,1,20,-1,1);
TH2F *h4 = new TH2F("h4","test4",10,0,1,20,0,1000);
c1->cd(1);
gPad->SetTickx(2);
h1->Draw();
c1->cd(2);
gPad->SetTickx(2);
gPad->SetTicky(2);
h2->GetYaxis()->SetLabelOffset(0.01);
h2->Draw();
c1->cd(3);
h3->Draw();
c1->cd(4);
gPad->SetTicky(2);
h4->Draw();
}
Author
Rene Brun

Definition in file zones.C.

TH2F
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
TAttAxis::SetLabelOffset
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
Definition: TAttAxis.cxx:192
h1
TH1F * h1
Definition: legend1.C:5
zones
Definition: zones.py:1
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TH1::GetYaxis
TAxis * GetYaxis()
Definition: TH1.h:318
TStyle::SetOptStat
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition: TStyle.cxx:1592
TCanvas
Definition: TCanvas.h:23
gPad
#define gPad
Definition: TVirtualPad.h:287
TH1::Draw
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2997
c1
return c1
Definition: legend1.C:41