Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Reducing the space between the legends for the LineLegend?

POSTED BY: Haolin Li
2 Replies
Posted 3 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Hi Haolin,

I am unable to reproduce the problem on "13.0.1 for Mac OS X ARM (64-bit) (January 28, 2022)".

enter image description here

So perhaps it is a bug in v12. As a workaround, the Spacings option does work even though it is not documented and is highlighted as an error in the front end. Try this

Plot[{t, t^2, Sin[t]}, {t, 0, Pi},
 PlotRange -> All,
 PlotPoints -> 10,
 Frame -> True,
 FrameStyle -> Thick,
 Axes -> {True, False}, 
 PlotLegends -> 
  Placed[
   LineLegend[{"t", "\!\(\*SuperscriptBox[\(t\), \(2\)]\)", "Sin[t]"},
     LegendFunction -> "Frame", 
     LegendLayout -> "Column", 
     Spacings -> 0.1], {{0.3, 0.9}, {1, 1}}], 
 GridLines -> {Pi*#/4 & /@ Range[0, 4], Automatic}, 
 BaseStyle -> {FontSize -> 15, FontFamily -> "Times New Roman", Thick}, 
 PlotStyle -> {{Thickness[0.005], Dotted, Cyan}, {Thickness[0.005], Dashed},
   {Thickness[0.005]}},
 ImageSize -> 500]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard