User Tools

Site Tools


root:addlegend

Adding a legend

 TLegend *legend = new TLegend(0.65,0.85,0.95,0.75); //xmin,ymin,xmax,ymax in percent from lower left corner
 legend->AddEntry(histogram1, "name1");
 legend->AddEntry(histogram2, "name2");
 legend->SetFillColor(kWhite);  // otherwise you get an ugly grey background
 legend->Draw();
root/addlegend.txt · Last modified: 2010/11/09 16:43 by nchiap