Control length of line in legend

In this example:

  gStyle -> SetOptStat(kFALSE);
  gStyle -> SetOptTitle(kFALSE);
  TH1 * h = new TH1F("h", "h", 5, 0.0, 5.0);
  h -> FillRandom("gaus", 500);
  TLegend * legend = new TLegend(0.5, 0.5, 0.9, 0.9);
  legend -> AddEntry(h, h -> GetTitle(), "lp");
  TCanvas * c = new TCanvas;
  h -> Draw();
  legend -> Draw("SAME");

how can I control the length of the line in the legend?


Please read tips for efficient and successful posting and posting code

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


Isn’t it the same:

1 Like

The answer is here Control length of line in legend

it is TLegend::SetMargin()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.