TGraph *graph = new TGraph(npoints, x, y); //create a TGraph object graph->SetMinimum(0); //set the minimum value for y-axis
TGraphErrors *graph = new TGraphErrors(npoints, x, y, xerr, yerr); //create a TGraphErrors object graph->SetMinimum(-10); //set the minimum value for y-axisIn this example, we create a TGraphErrors object with npoints number of points in the x, y, xerr, and yerr arrays. We then call the SetMinimum function to set the y-axis minimum value to -10. This can be useful when plotting data that has both positive and negative values. Overall, the SetMinimum function is used to set the minimum value for the y-axis in a TGraph object. It is part of the ROOT (CERN) package library.