worldbank / wbgviz

Several R packages for World Bank-standard visualisations, building on ggplot2
MIT License
30 stars 12 forks source link

Make figure-left legend alignment a feature of figure() and possibly a helper function #18

Open econandrew opened 6 years ago

econandrew commented 6 years ago

Currently this works per figure

      # Hack to align legend figure-left - TODO: move this into figure() or elsewhere
      g <- ggplotGrob(p)
      g$layout$l[g$layout$name == "guide-box"] <- g$layout$l[g$layout$name == "guide-box"] - 1
      g$theme <- style$theme()
      g