27 C =
new TCanvas(
"C",
"canvas",1024,640);
41 CanvasPartition(C,Nx,Ny,lMargin,rMargin,bMargin,tMargin);
46 h =
new TH1F(
"histo",
"",100,-5.0,5.0);
53 for (
Int_t i=0;i<Nx;i++) {
54 for (
Int_t j=0;j<Ny;j++) {
59 sprintf(pname,
"pad_%i_%i",i,j);
60 pad[i][j] = (
TPad*)
gROOT->FindObject(pname);
71 sprintf(hname,
"h_%i_%i",i,j);
122 Float_t vStep = (1.- bMargin - tMargin - (Ny-1) * vSpacing) / Ny;
125 Float_t hStep = (1.- lMargin - rMargin - (Nx-1) * hSpacing) / Nx;
127 Float_t vposd,vposu,vmard,vmaru,vfactor;
128 Float_t hposl,hposr,hmarl,hmarr,hfactor;
130 for (
Int_t i=0;i<Nx;i++) {
134 hposr = lMargin + hStep;
135 hfactor = hposr-hposl;
136 hmarl = lMargin / hfactor;
138 }
else if (i == Nx-1) {
139 hposl = hposr + hSpacing;
140 hposr = hposl + hStep + rMargin;
141 hfactor = hposr-hposl;
143 hmarr = rMargin / (hposr-hposl);
145 hposl = hposr + hSpacing;
146 hposr = hposl + hStep;
147 hfactor = hposr-hposl;
152 for (
Int_t j=0;j<Ny;j++) {
156 vposu = bMargin + vStep;
157 vfactor = vposu-vposd;
158 vmard = bMargin / vfactor;
160 }
else if (j == Ny-1) {
161 vposd = vposu + vSpacing;
162 vposu = vposd + vStep + tMargin;
163 vfactor = vposu-vposd;
165 vmaru = tMargin / (vposu-vposd);
167 vposd = vposu + vSpacing;
168 vposu = vposd + vStep;
169 vfactor = vposu-vposd;
177 sprintf(name,
"pad_%i_%i",i,j);
180 pad =
new TPad(name,
"",hposl,vposd,hposr,vposu);
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
void SetFrameBorderMode(Int_t mode=1)
R__EXTERN TStyle * gStyle
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual void SetBorderMode(Short_t bordermode)
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
tomato 1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetTitleFont(Style_t font=62)
Set the title font.
void CenterTitle(Bool_t center=kTRUE)
Center axis title.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
virtual void Reset(Option_t *option="")
Reset.
void SetFrameFillStyle(Style_t styl=0)
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates).
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
virtual void Draw(Option_t *option="")
Draw Pad in Current pad (re-parent pad if necessary).
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Double_t GetAbsWNDC() const
The most important graphics class in the ROOT system.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title The size is expressed in per cent of the pad width.
virtual void SetFillStyle(Style_t fstyle)
Override TAttFill::FillStyle for TPad because we want to handle style=0 as style 4000.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
Double_t GetAbsHNDC() const
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
virtual void SetBorderSize(Short_t bordersize)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.