For gradient legends, we draw a custom color swatch using grDevices::as.raster and add labels, tick marks, and title manually.
draw_gradient_swatch(
legend_args,
fklgnd,
lmar,
outer_side,
outer_end,
outer_right,
outer_bottom,
user_inset = FALSE
)NULL (draws gradient legend as side effect)
Legend arguments list
Fake legend object (from drawing with plot=FALSE)
Legend margins
Logical flag for outer side placement
Logical flag for outer end placement
Logical flag for outer right placement
Logical flag for outer bottom placement
Logical flag indicating user-supplied inset