TH1D* histo = new TH1D("histo","Histogram Title",100,0,100); histo->Fill(50); histo->SetAxisRange(40,60,0);
TH1D* histo = new TH1D("histo","Histogram Title",100,0,100); histo->Fill(50); histo->SetAxisRange(0,1,1);In this example, a histogram with 100 bins and a range of 0-100 is created. The histogram is then filled with a value of 50. The SetAxisRange method is used to set the y-axis range to 0-1. Both examples use the SetAxisRange method to modify the axis range of the histogram. The package library used is ROOT.