0

Here is a reproducible example:

library(magrritr)
library(ggplot2)
dplyr::bind_rows(iris,iris,iris, .id = "df") %>%
  ggplot(aes(x = Petal.Width, y = Petal.Length, color = Species)) + 
  geom_point() + 
  facet_wrap(~ df, ncol = 2)

enter image description here

The legend takes a big proportion of the image width when there is a blank space due to a "missing" facet.

Is is possible to move the legend to the bottom-right ("missing" facet) to increase the width of other plots and keep the legend information?

VFreguglia
  • 2,129
  • 4
  • 14
  • 35
  • 4
    Duplicate of [Shift legend into empty facets of a faceted plot in ggplot2](https://stackoverflow.com/questions/54438495/shift-legend-into-empty-facets-of-a-faceted-plot-in-ggplot2) – M-- May 22 '19 at 19:52
  • That other question solves my problem. I didn't find the right words to search I guess. Thank you! – VFreguglia May 22 '19 at 21:42

0 Answers0