ggsubplot
ggsubplot copied to clipboard
Adding reference boxes screws up scale limits
Here's an example
n <- 10
df <- data.frame(y = rnorm(4*n),
group = rep(letters[1:4], each = n),
long = rep(c(-120, -80, -110, -70), each = n),
lat = rep(c(45, 30), each = 2*n))
ggplot(df, aes(long, lat)) +
geom_subplot(aes(long, lat, group = group,
subplot = geom_histogram(aes(y, ..count..))))
# now try to add reference boxes
ggplot(df, aes(long, lat)) +
geom_subplot(aes(long, lat, group = group,
subplot = geom_histogram(aes(y, ..count..))), ref = ref_box())
# scale limits are way too big!