Hi
I have an R script which works well if the facet_wrap
's n_row
is small. However if I increase n_row
to a large number the plot area of each chart is reduced to a very small plot. Here is the script:
group_by(Session,Site,Risk) %>%
summarise(n=n()) %>% top_n(10)
plot1 <- ggplot(DF, aes(x = Session, y = n, color = Risk)) +
theme(axis.text.x = element_text(angle = 45), legend.position="bottom",
legend.text = element_text(size=7)) + geom_point() +
geom_line(aes(group = Risk), lty = 3) + guides(colour = guide_legend(nrow = 3)) +
facet_wrap(~ Site, nrow = 4)
ggplotly(plot1) %>% layout(legend = list(orientation = "h", x = 0.4, y = -0.2))
so for nrow=4, the charts look acceptable:
However if I increase nrow to 32 in order to see only one chart per line, it becomes like this:
So I was thinking to increase the the vertical size of the overall plot if that is the best approach.
How do I do it? Or is there a better way?