Example of a canvas showing two histograms with different scales.
More...
Go to the source code of this file.
Example of a canvas showing two histograms with different scales.
The second histogram is drawn in a transparent pad
void transpad() {
TPad *pad1 =
new TPad(
"pad1",
"",0,0,1,1);
TPad *pad2 =
new TPad(
"pad2",
"",0,0,1,1);
TH1F *h1 =
new TH1F(
"h1",
"h1",100,-3,3);
TH1F *h2 =
new TH1F(
"h2",
"h2",100,-3,3);
for (
Int_t i=0;i<100000;i++) {
if (i <1000) h1->
Fill(x1);
}
pad2->
Range(xmin-0.1*dx,ymin-0.1*dy,xmax+0.1*dx,ymax+0.1*dy);
TGaxis *axis =
new TGaxis(xmax,ymin,xmax,ymax,ymin,ymax,50510,
"+L");
}
- Author
- Rene Brun
Definition in file transpad.C.