Hi All
I have a few histograms, lets say h1, h2 ,h3, initially defined as
TH1F *h1 = new TH1F(“h1”,“test hstack”,100,-4,4);
TH1F *h2 = new TH1F(“h2”,“test hstack”,100,-4,4);
TH1F *h3 = new TH1F(“h3”,“test hstack”,100,-4,4);
and I later stack them together into a THStack object hs
THStack *hs = new THStack(“hs”,“test stacked histograms”);
I would like to re-set the x-axis range to (-3,3), but I have tried using
h1->GetXaxis()->SetRangeUser(-3.,3.);
h2->GetXaxis()->SetRangeUser(-3.,3.);
h3->GetXaxis()->SetRangeUser(-3.,3.);
or
h1->SetAxisRange(-3.,3.);
h2->SetAxisRange(-3.,3.);
h3->SetAxisRange(-3.,3.);
before stacking, or the same tricks to hs but still nothing worked, the code I have included only plotted the histogram in the range (-3,3), but the displayed x-axis remains at (-4,4). Any ideas?
Cheers for the help
Jason