Drawing multiple histograms in one Canvas

Hi, I am trying to draw multiple histograms in one canvas. All of them are normalized.

The code is here…
Double_t scale4 = 1/(hist1_4 ->Integral());
hist1_4->Scale(scale4);
Double_t scale3 = 1/(hist1_3 ->Integral());
hist1_3->Scale(scale3);
Double_t scale2 = 1/(hist1_2 ->Integral());
hist1_2 ->Scale(scale2);
Double_t scale = 1/(hist1 ->Integral());
hist1 ->Scale(scale);
hist1_3 ->GetXaxis()->SetTitle(“GeV”);
hist1_3->Draw(“same”);
hist1->Draw(“same”);
hist1_2->Draw(“same”);
hist1_4->Draw(“same”);
But after drawing one of the histogram has large peak so the others are diminished. Is it possible to increase heights of the all other histograms? So that all the histograms will be clearly visible in the canvas.

You should first plot the histogram with larger ranges along X and Y axis (without option “same”). Or you can let ROOT compute the global range using THStack.

Thanks!! I am trying to plot the histogram with larger dynamic along X and Y axis.
i.e hist1_4 (yellow) is plotted first then the others . But this time the histogram with larger peak got cut from the top .

Trying not to use stacked histograms.

Yes that’s the solution of your problem.

Thanks, I will try stacked histograms.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.