I am trying to adjust a range of THStack y axis (by hstack->GetYaxis()->SetMaximum(ymax); ). However, the range is smaller than some contents of bins, thus the plot is out of the range (look at the attached plot please) so that it looks ugly. Any hint not to show the part outside?
Can you send a small macro reproducing this problem ?
Yes, here you go:
TH1F * h1 = new TH1F("h1", "h1", 100, -3., 3.);
TH1F * h2 = new TH1F("h2", "h2", 100, -3., 3.);
THStack * hs = new THStack("hs", "");
If I use ‘nostack’ mode of THStack, I can specify each histogram’s range to solve the problem, however, it is not working for hstack->Draw() stack mode.
This is now fixed in the svn trunk. Thanks to have reported this problem.