7
$\begingroup$

Here we have a simple example

Clear["Global`*"];

col = {Green, Blue, Red, Purple};
lab = {"Label 1", "Label 2", "Lable 3", "Label 4"};
leg = PointLegend[col, lab, LegendMarkers -> {Style[●, 12]}, LabelStyle -> {FontFamily -> "Helvetica", 17}]

enter image description here

Is there a way to reduce the vertical distance between the labels?

$\endgroup$
7
$\begingroup$

You can use the (undocumented) option Spacings:

Row[PointLegend[col, lab, 
    LegendMarkers -> {Style[\[FilledCircle], 12]}, 
    LabelStyle -> {FontFamily -> "Helvetica", 17}, 
    Spacings -> #] & /@ {.1, .5, 1}]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ It's working, even though the option Spacings is colored red thus meaning unkown option. $\endgroup$ – Vaggelis_Z May 4 '20 at 11:13
  • $\begingroup$ It would be nice to see the ability to align labels with their markers. it would be more obvious if these were squares. I had to roll my own legend to fix it. Maybe not an appropriate place for this comment, but, nice work as always, kglr! $\endgroup$ – CA Trevillian May 5 '20 at 2:54
  • 1
    $\begingroup$ @CATrevillian, Vertical (mis-)aligning of plotmarkers and legend text may be relevant/useful. $\endgroup$ – kglr May 5 '20 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.