legend_*(by = <aes>) and
legend_style(by = <aes>) now compose correctly when
chained for the same aesthetic. Previously, each call built a fresh
guide_legend() that replaced the prior one, so
legend_top(by = "colour") + legend_style(by = "colour", margin = ...)
silently reset the colour legend’s position back to the plot default.
The per-aesthetic helpers now return a ggguides update object whose
ggplot_add method merges new params into the existing
guide. This fixes the “Four Legends, One per Side” vignette example.
(reported by Youtao)legend_inside(): renamed just argument to
justification for consistency with
legend_style(justification = ...) and ggplot2’s
legend.justification theme element. The old
just name still works but emits a deprecation warning.legend_style() gains a justification
argument. With by = NULL it sets
legend.justification globally; with
by = "<aes>" it slides a single legend along its side
via guide_legend(theme = ...). Useful when four legends sit
on four different sides and each needs its own alignment.multiple-legends vignette: added a “Four Legends, One
per Side” section showing per-legend side, justification, and margin
adjustments together.\donttest{} with
if(requireNamespace()) conditionals for examples using
suggested packagesget_legend() returning empty grob with ggplot2
3.5.0+ (guide-box naming changed to position-specific names like
“guide-box-right”)@return documentation to all S3 methods
(ggplot_add, print, plot, and ggplotGrob methods)\dontrun{} to \donttest{} in
examples that require suggested packageslegend_keys(): Added detailed documentation
explaining how to use filled shapes (21-25) with different outline/fill
color combinations. Clarified that “colored fill with black outline”
requires mapping both color and fill
aesthetics in the original plot (#1).
Added new example showing correct usage for colored fills with black outlines.