Adjust scope of THStack

Hi,
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?

Cheers,
Zhiyi.

Can you send a small macro reproducing this problem ?

Hi,
Yes, here you go:

{
  TH1F * h1 = new TH1F("h1", "h1", 100, -3., 3.);
  TH1F * h2 = new TH1F("h2", "h2", 100, -3., 3.);

  h1->FillRandom("gaus", 5000);
  h2->FillRandom("gaus", 4000);

  THStack * hs = new THStack("hs", "");
  hs->Add(h1);
  hs->Add(h2);

  hs->Draw("nostack");
  hs->SetMaximum(100);

}

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.

Cheers,
Zhiyi.

thanks

This is now fixed in the svn trunk. Thanks to have reported this problem.