Good day!
I have a lot of data files and I want to plot it on the same canvas. This function work pretty well, but unfortunately it can’t change the graph Line Color. So I have all graphs with the same color.
How I can fix this problem?
{
auto c = new TCanvas("c","A Simple Graph without axis",700,500);
const Int_t n = 10;
auto gr = new TGraph();
gr->SetTitle("A Simple Graph Example");
gr->GetXaxis()->SetTitle("X axis");
gr->SetEditable(kFALSE);
gr->SetMarkerColor(3);
gr->SetLineColor(2);
Double_t x, y;
for (Int_t i=0;i<n;i++) {
x = i*0.123;
y = 10*sin(x+0.2);
gr->AddPoint(x,y);
}
gr->Draw("A*L");
}