{ //http://www.slac.stanford.edu/BFROOT/www/doc/workbook/root1/root1.html int indA=3; //put on x axis the mass of the particle for example float xA[indA]={250,500,750}; //on the y axis put the number you want to plot for each particle mass float yA[indA]={0.25,0.3,0.6}; // then here - fill in the errors for the x and the y points float xeA[indA]={0,0,0}; float yeA[indA]={0,0,0}; graphA = new TGraphErrors(indA, xA, yA, xeA, yeA); graphA->SetMarkerStyle(4); graphA->SetMarkerSize(0.7); graphA->Draw("APL"); // leg = new TLegend(0.6,0.7,0.89,0.89); //coordinates are fractions // //of pad dimensions // leg->AddEntry(graphA,"First histo","l"); // "l" means line // // use "f" for a box // leg->Draw(); // // oops we forgot the header (or "title") for the legend // leg->SetHeader("The Legend Title"); // leg->Draw(); }