Hi
I am searching for a way to plot 3 histograms with different binning in the same plot unsuccessfully.
histogram1: 250 bins from 0.0 to 2.5 GeV/cˆ2
histogram2: 60 bins from 2.5 to 4.0 GeV/cˆ2
histogram3: 80 bins from 4.0 to 8.0 GeV/cˆ2
I have tried many things from manual with no luck.
Would you please have some hint ?
thanks
Luiz Regis
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Hi Wile,
I got the following error: (ROOT5)
root [14] THStack *hs = new THStack(“hs”,"");
root [15] hs->Add(hm2rec2OS_ttbb3);
root [16] hs->Add(hm2rec2OS_ttbb4);
root [17] hs->Add(hm2rec2OS_ttbb5);
root [18] hs->Draw();
Error in TH1F::Add: Attempt to add histograms with different number of bins
Error in TH1F::Add: Attempt to add histograms with different number of bins
ROOT6:
root [6] THStack *hs = new THStack(“hs”,"");
root [7] hs->Add(hm2rec2OS_ttbb3);
root [8] hs->Add(hm2rec2OS_ttbb4);
root [9] hs->Add(hm2rec2OS_ttbb5);
root [10] hs->Draw();
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
Info in TH1F::Add: Attempt to add histograms with different number of bins - trying to use TH1::Merge
Error in : Cannot merge histograms - limits are inconsistent:
first: hm2rec2OS_ttbb4 (60, 2.500000, 4.000000), second: hm2rec2OS_ttbb3 (125, 0.000000, 2.500000)
Info in TH1F::Add: Attempt to add histograms with different number of bins - trying to use TH1::Merge
Error in TH1Merger::DifferentAxesMerge: Cannot merge histograms - the histograms hm2rec2OS_ttbb5 can extend the X axis or have different limits and underflows/overflows are present in the histogram hm2rec2OS_ttbb5.
What I want is to plot first one from 0 to 2.5 , the second one from 2.5 to 4.0, third one from 4.0 to 8.0 resulting in just one histogram.
Luiz