TLegend problem

Good evening, dear rooters.
I have some problem with TLegend. How I can plot TLegend color same as data points color? Sorry, for my english.9B_40MeV.pdf (18.5 KB)
mass2.C (2.0 KB)
9Be_elas_40Mev.txt (1.1 KB)
9B_gs_40MeV.txt (1.1 KB)


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


1 - There is no SetMarkerColor for TLegend, so delete that line.
2 - Your graphs don’t have names, so you should use the name of the TGraph objects (variables); in this case, remove the quotations when adding them to the TLegend:

   leg->AddEntry(Gr1,"{}^{9}Be({}^{3}He,{}^{3}He){}^{9}Be, g.s","EP");
   leg->AddEntry(Gr2,"{}^{9}Be({}^{3}He,t){}^{9}B, g.s","EP");

or give them names (Gr1->SetName("Gr1");...) before adding them.

Thanks a lot