How to programmatically assign a good width to a graph in ggplot2

Viewed 266

I'm generating a lot of faceted graphs with discrete x-axis inside my R scripts. Sometimes, I get overlapping labels in x-axis, and I would like to avoid it:

ggsave overlaps

Since I don't know in advance how big the graph is going to be (number of facets and breaks), I can't assign it manually to ggsave.

Any tips or best practices in this case?

2 Answers
Related