I have some datasets that contain more legend entries than can comfortably be distinguished with colors or at all displayed with symbols. It's effectively a rainbow, but across so many legend entries that they make the plots much higher than wide.
Since the legends are not really as important as comfortable sizing of the plot, I merely preview and remove them before saving the plots to PNGs.
Like this:
library(ggplot2)
p <- ggplot(diamonds, aes(cut, depth)) + geom_point(aes(colour = factor(carat), size = price))
p
p <- p + theme(legend.position = "none")
p
However, having only the choice of either skewing the plot height or kicking the legend out completely, is a bit frustrating. A neat compromise would be to have the legend in a separate PNG, so it can be checked when really necessary. Is there a way to do this?