User Tools

Site Tools


root:setaxisrange

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
root:setaxisrange [2011/05/11 15:39] – [Y Axis of a normalized Histogram] nchiaproot:setaxisrange [2014/03/11 10:20] (current) – [X Axis of TGraph] add missing call to GetXaxis nchiap
Line 23: Line 23:
 hist->GetYaxis()->SetRangeUser(normalizedLower*scaleY,normalizedUppe*scaleY); hist->GetYaxis()->SetRangeUser(normalizedLower*scaleY,normalizedUppe*scaleY);
 </code> </code>
 +
 +===== Y Axis of a THStack =====
 +Do not try to ''SetLimits'' or ''SetRangeUser'' of any histogram.
 +Instead use the following code:
 +<code c++>
 +THStack *hs = new THStack("hs","test stacked histograms");
 +hs->SetMinimum(0.);
 +hs->SetMaximum(10.);
 +</code>
 +
  
 ===== X Axis of TGraph ===== ===== X Axis of TGraph =====
Line 32: Line 42:
 TGraph* myGraph = new TGraph(); TGraph* myGraph = new TGraph();
 ... ...
-myGraph->SetLimits(lower,upper);+myGraph->GetXaxis()->SetLimits(lower,upper);
 </code> </code>
  
  
root/setaxisrange.txt · Last modified: 2014/03/11 10:20 by nchiap