TGraph* graph = new TGraph(nPoints, xData, yData); graph->SetMaximum(10);
TGraphErrors* graph = new TGraphErrors(nPoints, xData, yData, xErrors, yErrors); graph->SetMaximum(100);This code creates a TGraphErrors object with nPoints number of data points, with the x values from the xData array, the y values from the yData array, and the x and y error values from the xErrors and yErrors arrays. Then, it sets the maximum value of the y-axis scale to 100. Package/Library: ROOT C++ framework.