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).
void ZoomHistogram() {
TH1F *norm =
new TH1F(
"Normal Histogram",
"Normal Histogram", 100, 0, 100);
for (int i = 0; i < 100; ++i) {
}
}
R__EXTERN TRandom * gRandom
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
- Author
- Advait Dhingra
Definition in file ZoomHistogram.C.