Helper utility to get an econodist legend into a ggplot2 plot

add_econodist_legend(gg, legend, below = "subtitle", just = c("left",
  "center", "right"), legend_height = unit(16, "points"),
  spacer = unit(10, "points"))

Arguments

gg

ggplot2 plot object to add

legend

legend grob (any grob, really)

below

which named gtable element to stick it below?

just

legend position: "left" (aligned with left veritcal axis), "center" (center of plot panel), or "right" (aligned with right vertical axis). Uses pmatch() so partial matching is supported.

legend_height

height of the legend row

spacer

height of the spacer that is put below legend?

See also

Other Econodist legend helpers: econodist_legend_grob, left_align