wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
704 stars 84 forks source link

Allow get_legend to return NULL when there is no legend #100

Closed billdenney closed 6 years ago

billdenney commented 6 years ago

Fix #98

Due to the requirement of ggplot more recent than that on CRAN, I wrote the code and the test, but I couldn't actually test it (and I need the current CRAN version instead of development on my local system).

clauswilke commented 6 years ago

I don't see the need for an additional parameter. I think the function should simply return NULL when there is no legend. Also, please update the NEWS file. It's simple enough that I'll just merge once you've made these changes and then fix anything that turns out to be broken.

billdenney commented 6 years ago

Done!