[R] How to print the graphs in landscape/portrait orientation

Duncan Murdoch murdoch.duncan at gmail.com
Sun Apr 10 00:06:58 CEST 2016

On 09/04/2016 5:58 PM, jpm miao wrote:
> Hi,
>     I made a few graphs by ggplot. The following codes produce a pdf file
> with graphs in landscape orientation on my Windows PC, while they produce a
> pdf file with the same graphs, but in portrait orientation:
> *p2 <- lapply(1:(2*n), function(.x) xyz_outl[.x][[1]])  #a sequence of
> graphs made by ggplot*
> *m2 <- marrangeGrob(p2, nrow=3, ncol=2)  *
> *ggsave("xyz.pdf", m2)*
>      Question: how can I let the graphs printed in landscape orientation on
> my Mac? I try to add the following line before the above code, but it does
> not work.
> *pdf(paper = "Usr")*
>     Thanks!
> 	[[alternative HTML version deleted]]

None of that is runnable by anyone else.  If you want help, please make 
an effort to be considerate of the people who are trying to help you.

  - Don't post in HTML.  Those asterisks make your code unusable.

  - Do post self-contained examples.  Even if I spent the time to edit 
your post into something I could run, it would fail, because I don't 
have copies of all the variables it uses.

Duncan Murdoch

More information about the R-help mailing list