This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
root:setaxisrange [2010/11/09 16:08] – created nchiap | root:setaxisrange [2011/05/11 15:35] – added solution for my latest problem nchiap | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Set Display Range of Axis ====== | ====== Set Display Range of Axis ====== | ||
+ | The normal way to change the display range of an axis is: | ||
<code C++> | <code C++> | ||
histogram-> | histogram-> | ||
+ | </ | ||
+ | |||
+ | but there are several situations where this fails. See below for help in these cases. | ||
+ | |||
+ | ===== Y Axis of a normalized Histogram ===== | ||
+ | Assume you have a histogram which has been normalized it with **hist-> | ||
+ | When your Y-axis will show values between 0 and 1. | ||
+ | Trying to set the Y range using these values, eg. **SetRangeUser(0.01, | ||
+ | You still need to give the range in the original unnormalized units. | ||
+ | |||
+ | You can scale normalized units back with: | ||
+ | <code C++> | ||
+ | Double_t scaleY = hist-> | ||
+ | hist-> | ||
</ | </ | ||