I am using ggplot2 to create a plot with facet_grid. I have two discrete variables that define the rows and columns of the panels. However, some of the rows have very small y-axis ranges, which makes them look too thin. I want to make each row have at least a certain height, regardless of the y-axis range. How can I do that?
example:
sed.seed(1234)
data <- data.frame(
x = runif(93),
y = c(sample(c(1:10, 100:110), 90, replace = TRUE), rep(3, 3)),
group1 = c(rep(LETTERS[1:3], 30), 'D', 'D', 'D')
)
library(ggplot2)
ggplot(data, aes(x = x, y = y)) +
geom_point() +
facet_grid(group1 ~ ., scales = "free_y", space = "free_y")
As you can note, some of the rows are very thin compared to others. I want to make them have a minimum height so that they are more visible. Is there any way to do that with ggplot2 or other packages? Thank you for your help.