SetAxisRange(0.0,1.0,"Y"); is ineffective

I am trying to draw 4 histograms on the same canvas.

When I do this:
input_hist1->SetAxisRange(0.0,1.0,“Y”);

This call is absolutely ineffective. It does nothing with the Y axis range. How do you set the Y axis range?

Okay, I figured it out, it is utterly retarded, SetAxisRange has to be called after you call Scale or it doesn’t work.

This is probably a bug, it shouldn’t matter when Scale is called.

1 Like

root.cern.ch/drupal/content/how-set-ranges-axis

From my experience … for a TH1 I am usually using something like this:
histo->Draw();
histo->SetAxisRange(xmin, xmax, “X”);
histo->SetAxisRange(ymin, ymax, “Y”);
histo->Draw(); // make sure it’s redrawn
If I am dealing with a THStack of several TH1 histograms, I am usually using something like this:
stack->Draw(“H”);
stack->GetXaxis()->SetLimits(xmin, xmax);
stack->SetMinimum(ymin);
stack->SetMaximum(ymax);
stack->Draw(“H”); // make sure it’s redrawn