zoowalk
zoowalk

Reputation: 2134

facet_grid with many factors becomes unreadable / increase size of plot?

Apologies if this is a very trivial question, but I have spent a few hours already on this. I have a ggplot with a facet grid which includes several factors. The problem is that the headings of the facets are not readable. There are 'too many'.

facet_grid(years.since.peace ~ type_of_termination+strategy.cm6.YP)

I know that I could change the font size of the panel headings, or split it into several different graphs. But what I am interest in is to enlarge the plot area so that there is enough space for all headings of the panels/facets? The graph is likely to end up as a poster, so printing it in e.g. A2 would be fine.

I checked the space, scale and shrink options - but it seems they are not meant for what I am trying to do. I also tried to modify the pdf() command with its width and height options. But the graph simply becomes larger without solving the problem of the unreadable facet headings.

Maybe I am simply wrong with what I am trying to do?

enter image description here

Upvotes: 6

Views: 1673

Answers (1)

Nick DiQuattro
Nick DiQuattro

Reputation: 739

you could try:

library(ggplot2)
ggsave('testplot.png', height = 11, width = 8.5)

Upvotes: 2

Related Questions