Changing line thickness in TLegend

I would like to know how to change the line thickness in TLegend (ROOT v5.02/00). In my code I am doing the following, where “h” is a TH1F*.

[code]h->SetLineColor(kRed);
h->SetLineWidth(2);

TLegend* leg = new TLegend(0.6, 0.5, 0.8, 0.7);
TLegendEntry* leg1 = leg->AddEntry(h, “some histogram”, “l”)

h->Draw();
leg->Draw();
[/code]
I can change the thickness of the plotted histogram line using

but this does not affect the thickness of the legend line. I also tried

which seems to make the line longer or shorter, without changing the thickness.

(I also tried changing the same thing substituting SetLineStyle() for SetLineWidth() and was not able to change the legend line style.)

Perhaps this is a bug? My opinion is that it would make sense for the default TLegend line style to automatically reflect the plotted line style…

Thanks!

Here is a small example. Seems to me the line width is taken into acount by TLegend. What is your ROOT version ?

{
   TH1F *h1=new TH1F("h1","h1",5,0,5);
   h1->SetFillStyle(3004);
   h1->SetFillColor(1);
   h1->Fill(3);
   h1->Draw();
                                                                                
   TH1F *h2=new TH1F("h2","h2",5,0,5);
   h2->SetFillStyle(3005);
   h2->SetFillColor(1);
   h2->SetLineColor(2);
   h2->SetLineWidth(6);
   h2->Fill(2);
   h2->Draw("SAME");
                                                                                
   TLegend *leg=new TLegend(0.2,0.2,0.4,0.4);
   leg->AddEntry(h1,"h1","f");
   leg->AddEntry(h2,"h2","f");
   leg->SetEntrySeparation(0.1);
   leg->Draw();
}

The problem was operator error (oops). I was rebinning the histogram, and setting the rebinned version to use a thicker line. The legend entry was tied to the original histogram, and thus used the original line width.