This is my first time posting a question here so I'm nervous, but this has been bugging me forever: when using facet_wrap() in ggplot, is there a way to keep your plots from getting all squished when you have a lot of them? (see example below)
There is too much range in the data so I have to free the scales, otherwise I would set the y-axis breaks and probably have fewer labels to that from crowding. But the biggest thing is that the plots are so squished they become hard to see. When I put space in between the plots it just squishes them more as though it is working with a limited amount of space. I also tried adjusting font sizes, getting rid of the title, and even the legend. Removing the legend makes more room but obviously, that's sort of an important thing to have in there!
Is there a way to fix this or is this just something that goes with trying to facet a lot of plots?
Here is my code:
lu_acres_plot <- ggplot(data = land_use_acres, aes(x = land_use, y = acres)) +
geom_col(aes(fill = land_use)) +
facet_wrap(~i_desclu, scales = "free_y") +
labs(title = "Land Use Change",
y = "Change in Acreage") +
theme_minimal() +
geom_hline(aes(yintercept=0)) +
scale_fill_manual(values = lu_pallette) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
text = element_text(family = "Times"),
axis.text = element_text(size = 12),
axis.title = element_text(size = 14, face = "bold"),
plot.title = element_text(size = 16, face = "bold"),
legend.position = "bottom",
legend.title = element_text(size = 14, face = "bold"),
legend.title.align = 0.5,
strip.background = element_rect(color = "grey40", fill = "grey30"),
strip.text = element_text(size = 9, color = "white", face = "bold"),
panel.border = element_rect(color = "grey40", fill = NA)
) +
guides(fill = guide_legend(title = "Land Use",
title.position = "top",
nrow = 2))
lu_acres_plot