Please read tips for efficient and successful posting and posting code
_ROOT Version: 6.24/06
Platform: Not Provided
Compiler: Not Provided
Hi everyone,
I am having trouble plotting histograms with a specified range. To give some context I am plotting the same histogram on a canvas divided in two parts. Left part where I want the histogram to be plotted within a set of bin lets call it range 1 and the right part the same histogram but in range 2.
I wrote this code
for(Int_t i = 1; i <= 3; i++){
TCanvas *c = new TCanvas(TString::Format("h%d", i), TString::Format("h%d", i), 1400, 600);
c->Divide(2, 1);
c->cd(1);
h[i]->GetXaxis()->SetRange(h[i]->FindFixBin(TETRA_thr_inf[i]), h[i]->FindFixBin(TETRA_thr_sup[i]));
h[i]->Draw();
c->cd(2);
hbis[i]->GetXaxis()->SetRange(hbis[i]->FindFixBin(TETRA_thr_inf2[i]), hbis[i]->FindFixBin(TETRA_thr_sup[i]));
hbis[i]->Draw();
}
As you can see I already tried to have the same histograms in two different variables called h and hbis. Notice the different ranges (inf, sup) and (inf2, sup). When executing my code ROOT will show me only the last range called for both pads in my canvas.
How do I solve that ?
Thanks for reading me !
Marius