TGraph* graph = new TGraph(); //... add data points to graph... graph->SetLineColor(kBlue); //set the line color to blue
TGraph* graph1 = new TGraph(); //... add data points to graph1... TGraph* graph2 = new TGraph(); //... add data points to graph2... graph1->SetLineColor(kRed); //set the line color of graph1 to red graph2->SetLineColor(kGreen); //set the line color of graph2 to greenThis example sets the color of two graphs to different colors, red and green respectively. Package Library: ROOT is the package library that provides TGraph class in C++. ROOT is a scientific data analysis software framework that is used to create and analyze large-scale scientific data. It is used extensively in physics research, particularly high-energy physics, to analyze and visualize data from experiments.