TLegend* legend = new TLegend(0.1,0.1,0.3,0.3); legend->SetBorderSize(0); legend->SetLineWidth(2);
TLegend* legend = new TLegend(0.7,0.7,0.9,0.9); legend->SetBorderSize(1); legend->SetLineWidth(0.5);In this example, a new legend object is created with position coordinates in the TCanvas. The border size is set to 1 to add a border and the line width is reduced to 0.5. Both examples use the SetLineWidth function of the TLegend class in the ROOT package library to adjust the line width of the border around the legend.