Skip to main content
Tweeted twitter.com/StackMma/status/1516975222032945152
edited tags, rephrased question, reformatted code
Source Link
Syed
  • 59.4k
  • 5
  • 40
  • 95

I have the following LineLegend:

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

Is there a wayI tried to stack, e.g., a = test1 and a = test2 on top of each otherin a column but keep the overall legend presented as a row? I tried to accomplish this by pressing the Enter key between a = test1 and a = test2, but not only did thisit not work but, it also feelsseemed like a hacky way of solving the problem.

Is there an easya way to accomplish thisstack legend item text while maintaining a "Row" layout?

I have the following LineLegend:

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

Is there a way to stack, e.g., a = test1 and a = test2 on top of each other but keep the overall legend presented as a row? I tried to accomplish this by pressing the Enter key between a = test1 and a = test2, but not only did this not work but it also feels like a hacky way of solving the problem.

Is there an easy way to accomplish this?

I have the following LineLegend:

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

I tried to stack, e.g., a = test1 and a = test2 in a column but keep the overall legend presented as a row by pressing the Enter key between a = test1 and a = test2, but not only did it not work, it seemed like a hacky way of solving the problem.

Is there a way to stack legend item text while maintaining a "Row" layout?

edited tags
Link
Syed
  • 59.4k
  • 5
  • 40
  • 95
Source Link
MathIsHard
  • 579
  • 2
  • 6

Stacking lines of text in a LineLegend?

I have the following LineLegend:

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

Is there a way to stack, e.g., a = test1 and a = test2 on top of each other but keep the overall legend presented as a row? I tried to accomplish this by pressing the Enter key between a = test1 and a = test2, but not only did this not work but it also feels like a hacky way of solving the problem.

Is there an easy way to accomplish this?