Hello, following transpad.C example to plot two graphs with two different axis on the same figure.
I use the following margins in my rootlogon.C
ildStyle->SetPadBottomMargin(0.14);
ildStyle->SetPadTopMargin(0.02);
ildStyle->SetPadRightMargin(0.15);
ildStyle->SetPadLeftMargin(0.12);
From the transpad.C example, I adapted the following lines
//compute the pad range with suitable margins
Double_t ymin = 0;
Double_t ymax = 2000;
Double_t dy = (ymax-ymin)/0.8; //10 per cent margins top and bottom
Double_t xmin = -3;
Double_t xmax = 3;
Double_t dx = (xmax-xmin)/0.8; //10 per cent margins left and right
pad2->Range(xmin-0.1*dx,ymin-0.1*dy,xmax+0.1*dx,ymax+0.1*dy);
by
//compute the pad range with suitable margins
Double_t ymin = 1.35;
Double_t ymax = 1.55;
Double_t dy = (ymax-ymin)/0.84;
Double_t xmin = 26.1881;
Double_t xmax = 67.8044;
Double_t dx = (xmax-xmin)/0.73;
pad2->Range(xmin-0.12*dx,ymin-0.14*dy,xmax+0.15*dx,ymax+0.02*dy);
It almost works but I observed a little shift between the data on the second TGraph and the axis on the first pad (first point of the red data should be exactly at 30 and the last point exactyl at 64 ; if you take a crosshair, you see that it is not exactly the case)
I attached my rootlong.C and my C routine which plots the figure if you want to have a look.
Thanks in advance.
YZplusNoZ.C (7.88 KB)
rootlogon.C (2.53 KB)
YZplusNoZ.eps (12.5 KB)