I want to plot two histograms on top of one another which have differnet number of bins.
The first histogram has 40 bins and the second has 52 bins. I want to plot this so that there are 4 sections to the histogram, each section having 10 bins of the first histogram and 13 of the second.
Attached is the plot I have so far which has just fourty bins, therefore missing the last 13 bins of the second histogram. I looked at the
TH1F->Scale() function but it only scales the values on the y axis. I want to scale the values of the xaxis by 1/13 ideally. Is this possible?
Thanks.
If the histograms have the same X axis limits and if the number of bins along the X axis for both histogram is a multiple of 4, plotting the 2nd histogram with option SAME is enough. Example:
{
TH1F *h1 = new TH1F("h1","h1",4,0,4);
h1->FillRandom("gaus",10000);
h1->SetLineColor(2);
TH1F *h2 = new TH1F("h2","h2",8,0,4);
h2->FillRandom("gaus",10000);
h1->Draw();
h2->Draw("same");
}