// Example 1: Create a graph with error bars TCanvas *c = new TCanvas("c", "Graph with error bars"); TGraphErrors *graph = new TGraphErrors(10, x, y, xerr, yerr); graph->Draw("AP"); // Example 2: Set properties of the error bars TGraphErrors *graph = new TGraphErrors(10, x, y, xerr, yerr); graph->SetMarkerStyle(20); graph->SetMarkerSize(1); graph->SetLineColor(kRed); graph->SetLineWidth(2); graph->Draw("AP"); // Example 3: Fit a function to the graph with error bars TGraphErrors *graph = new TGraphErrors(10, x, y, xerr, yerr); TF1 *fit = new TF1("fit", "pol1", 0, 10); graph->Fit(fit); graph->Draw("AP");In each example, we create a TGraphErrors object using the constructor and pass in the data points, and their errors. We then can set properties such as marker style, size, line color, and line width. Finally, we can fit a function to the graph with error bars. The package library used is ROOT, a data analysis tool used in high energy physics.