I want to overlay two histograms containing the distribution of two samples each. I have based myself on the tutorial transpad.C, however the tutorial only accounts for different y-axis, not a different x-axis.
This is the code I’m currently using:
TCanvas *c1 = new TCanvas("c1","transparent pad",200,10,700,500);
TPad *pad1 = new TPad("pad1","",0,0,1,1);
TPad *pad2 = new TPad("pad2","",0,0,1,1);
pad2->SetFillStyle(4000); //will be transparent
Double_t dx = (xmax-xmin)/0.8;
Double_t dy = (ymax-ymin)/0.8;
TGaxis *axis = new TGaxis(xmax,ymin,xmax,ymax,ymin,ymax,510,"-G=");
The resulting plot is shown as an attachment. the x-axis shown is the one of pad1. The x-axis of the second pad goes from 0 to 1 and I don’t need it to be shown.
I don’t quite understand where the blue triangle underneath the plot and the red line on the right come from and how to remove them? I’m guessing it has to do with the pad sizes not matching up, but I can’t seem to fix it. Any help would be appreciated!