You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove space for legend title if it doesn't have a title #3587
Actually, here is a better approach. Just set the margins of legend.text appropriately.
In general, I'd like to get rid of legend.spacing.* altogether and just use margins on legend title and text to format the legend, but that requires different settings depending on whether the legend is laid out horizontally or vertically.
Activity
clauswilke commentedon Oct 27, 2019
It looks like a unit of
legend.spacing.xis inserted even if the name is missing.You can work around this issue by placing some spaces before and after the labels, so that setting
legend.spacing.xto zero doesn't cause problems.The legend drawing code is a bit of a mess, so I don't see an immediate approach to fixing this more generally.
steveharoz commentedon Oct 27, 2019
Thanks for the workaround!
clauswilke commentedon Oct 27, 2019
Actually, here is a better approach. Just set the margins of
legend.textappropriately.In general, I'd like to get rid of
legend.spacing.*altogether and just use margins on legend title and text to format the legend, but that requires different settings depending on whether the legend is laid out horizontally or vertically.Created on 2019-10-27 by the reprex package (v0.3.0)
brunomioto commentedon Apr 30, 2022
+1!
mcanouil commentedon Nov 24, 2022
I believe the extra spacing can be removed with
legend.box.spacing = unit(0, "pt").