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

**URL:** <https://root-forum.cern.ch/t/setaxisrange-0-0-1-0-y-is-ineffective/14040>\
**Category:** ROOT\
**Created:** [March 24, 2012, 7:15am UTC](https://root-forum.cern.ch/t/setaxisrange-0-0-1-0-y-is-ineffective/14040 "2012-03-24T07:15:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [April 11, 2012, 10:26am UTC](https://root-forum.cern.ch/t/setaxisrange-0-0-1-0-y-is-ineffective/14040/4 "2012-04-11T10:26:24Z")

</div>

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

---

_[View the full topic](https://root-forum.cern.ch/t/setaxisrange-0-0-1-0-y-is-ineffective/14040)._
