TH1D *hist = new TH1D("hist","Histogram",100,0,100); hist->Fill(20); hist->Fill(30); hist->SetMinimum(0); hist->Draw();
TH1D *hist = new TH1D("hist","Histogram",100,0,100); hist->Fill(20); hist->Fill(30); hist->SetMinimum(hist->GetMinimum()*0.9); hist->Draw();In this example, a histogram is created with 100 bins ranging from 0 to 100. Two values, 20 and 30, are filled in the histogram. The minimum value of y-axis is set dynamically by multiplying the current minimum value with 0.9. The histogram is then drawn on the screen. The package library used in these examples is ROOT.