jpm miao
2016-Apr-09 21:58 UTC
[R] How to print the graphs in landscape/portrait orientation
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]]
Duncan Murdoch
2016-Apr-09 22:06 UTC
[R] How to print the graphs in landscape/portrait orientation
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
John Kane
2016-Apr-10 13:16 UTC
[R] How to print the graphs in landscape/portrait orientation
There really is nothing there to work with. Please have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html John Kane Kingston ON Canada> -----Original Message----- > From: miaojpm at gmail.com > Sent: Sat, 9 Apr 2016 14:58:12 -0700 > To: r-help at r-project.org > Subject: [R] How to print the graphs in landscape/portrait orientation > > 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]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.____________________________________________________________ FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
David Winsemius
2016-Apr-10 16:50 UTC
[R] How to print the graphs in landscape/portrait orientation
> On Apr 9, 2016, at 2:58 PM, jpm miao <miaojpm at gmail.com> 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")*The orientation of saved pdf files is determined by the device doing the printing, typically Preview.app on a Mac, and not a feature of the pdf file itself and not specified by ggplot2 functions or by R. So this really is not an R question at all and you should direct subsequent questions to SuperUser.com.> Thanks! > > [[alternative HTML version deleted]]And do learn to post in plain text. It's really very easy in gmail. ______________________________________________> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA
Apparently Analagous Threads
- How to print the graphs in landscape/portrait orientation (revised)
- Mixing portrait/landscape in a postscript file
- lattice plot - portrait / landscape
- postscript problems (landscape orientation)
- To save Trellis Plots on A3 size paper (Portrait and Landscape)