Skip to main content
improved answer to include marker centering
Source Link
Syed
  • 59.4k
  • 5
  • 40
  • 95
Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  {"a = test1\na = test2"
   , "a = test3\na = test4"
   , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}]
 ]

enter image description here


EDIT

Is there a way to center the marker ...?

I will request you to explore some possibilities.

SeedRandom[1];
Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  Framed[Style[#, RandomColor[]], FrameStyle -> Red] & /@ {
    "a = test1\na = test2"
    , "a = test3\na = test4"
    , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}
  , LegendFunction -> (Framed[#, RoundingRadius -> 4, 
      FrameStyle -> Darker@Green, Alignment -> Top] &)
  ]
 , Top
 ]

enter image description here

Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  {"a = test1\na = test2"
   , "a = test3\na = test4"
   , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}]
 ]

enter image description here

Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  {"a = test1\na = test2"
   , "a = test3\na = test4"
   , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}]
 ]

enter image description here


EDIT

Is there a way to center the marker ...?

I will request you to explore some possibilities.

SeedRandom[1];
Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  Framed[Style[#, RandomColor[]], FrameStyle -> Red] & /@ {
    "a = test1\na = test2"
    , "a = test3\na = test4"
    , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}
  , LegendFunction -> (Framed[#, RoundingRadius -> 4, 
      FrameStyle -> Darker@Green, Alignment -> Top] &)
  ]
 , Top
 ]

enter image description here

Source Link
Syed
  • 59.4k
  • 5
  • 40
  • 95

Labeled[Plot[Exp[-0.03*t], {t, 0, 100}, Frame -> True]
 , LineLegend[ {Blue, Green, Red},
  {"a = test1\na = test2"
   , "a = test3\na = test4"
   , "a = test5\na = test6"}
  , LegendLayout -> {"Row", 1}
  , LegendMarkers -> {{"\[FilledCircle]", 15}, {"\[FilledUpTriangle]",
      15}, {"\[FilledSquare]", 15}}]
 ]

enter image description here