Rotate the ggplot2 plot object

I would like to rotate the complete ggplot object 90 °.

I do not want to use coord_flip , as this interferes with scale="free" and space="free" when using faces.

For example:

 qplot(as.factor(mpg), wt, data=mtcars)+ facet_grid(.~vs + am, scale="free",space="free") 

enter image description here

against

 qplot(as.factor(mpg), wt, data=mtcars)+ facet_grid(vs + am ~ ., scale="free",space="free")+ coord_flip() 

enter image description here

What I would like:

enter image description here

I will probably need to use gridExtra .

+6
r plot ggplot2
source share
2 answers
 print(p, vp=viewport(angle=-90)) 
+13
source share

Is this what you expected?

 qplot(x=wt, y=as.factor(mpg), data=mtcars) + facet_grid(vs + am ~ ., scale="free", space="free") 

"rotated" plot

+1
source share

All Articles