Hello!
In, for example, the graphic generated below, the facets are arranged in a three-by-three arrangement. There are 9 facets, so the last facet space is blank. The legend is added to the right of the entire plot, which interferes with the shape of the plots, for a fixed full figure size. Is it possible to place the legend in the blank space?
library(reshape)
library(ggplot2)
dat <- data.frame("class" = as.factor(rep(letters[1:5], each = 10)),
"age" = as.factor(rep(1:5, 10)),
"gender" = sample(c("M", "F"), replace = T, size = 50),
"score" = rnorm(n=50))
ggplot(dat, aes(x = class, y = score, colour = gender)) + geom_point() +
facet_wrap(~age)
Thanks folks!
Benjamin