TLegend Entry Not Drawing Correctly

Dear Root Authors,

I have encountered a problem with the drawing of legends, where the text in the legend is drawn but the line that should be alongside it is not displayed.

Here is a MWE that demonstrates the problem:

void test(){

   TCanvas*c = new TCanvas("c","c");

   TLegend* l = new TLegend(0.5,0.8,0.89,0.9);
   l->SetMargin(0.005);
   l->SetTextAlign(32);
   l->SetTextSize(0.05);
   l->SetTextFont(62);

   Double_t Graph0_fx1[2] = {
   2.026,
   2.026};
   Double_t Graph0_fy1[2] = {
   -1000,
   1000};

   TGraph *graph = new TGraph(2,Graph0_fx1,Graph0_fy1);
   graph->SetName("Graph0");
   graph->SetTitle("Graph");
   graph->SetFillStyle(1000);
   graph->SetLineStyle(9);
   graph->SetLineWidth(3);
   graph->Draw("AL");

   l->AddEntry(graph,"Prediction","L");
   l->Draw();
}

There should be a dashed black line drawn next to “Prediction” in the legend but root does not draw it on my system, and I have not been able to determine why.

Thanks.

ROOT Version: 6.18/04
Platform: Ubuntu 18.4.6
Compiler: Not Provided


Make this bigger, like 0.4

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