Changing the Range on the X-Axis of a Histogram
Image produced by .x ZoomHistogram.C
This demonstrates how to zoom into a histogram by changing the range on one of the axes (or both).
{
TH1F *
orig =
new TH1F(
"Normal Histogram",
"Normal Histogram", 100, 0, 100);
for (int i = 0; i < 1000; ++i) {
double x =
rng.Gaus(50, 10);
}
zoom->SetTitle(
"Zoomed-in Histogram");
zoom->GetXaxis()->SetRangeUser(50, 100);
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
1-D histogram with a float per channel (see TH1 documentation)
Random number generator class based on M.
- Date
- November 2024
- Author
- Advait Dhingra
Definition in file hist008_TH1_zoom.C.