[R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

Debs Majumdar debs_stata at yahoo.com
Sat Jun 16 01:06:05 CEST 2012


I am using R 2.15.0 on Windows 7.

It shows the plots on the screen. I can page-up and page-down to look at the different plots. It's when I want to save the plot, I get a blank pdf file (0 kb).

#############
> pdf("education.pdf")
> plot(ed_dif, labels = c("White", "African American"))
> dev.off()
pdf 
  2 
> 
############  




----- Original Message -----
From: R. Michael Weylandt <michael.weylandt at gmail.com>
To: Debs Majumdar <debs_stata at yahoo.com>
Cc: "r-help at r-project.org" <r-help at r-project.org>
Sent: Friday, June 15, 2012 3:48 PM
Subject: Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

On Fri, Jun 15, 2012 at 4:39 PM, Debs Majumdar <debs_stata at yahoo.com> wrote:
> Hi,
>
> I am trying to save multiple plots in a single pdf file when  the plots are generated by a single plot command. I am using the "lordif" package which generates multiple plots with one command.
>
> pdf("education.pdf")
> plot.lordif(ed_dif, labels = c("White", "African American"))
> dev.off()
>
> And this is not working at all. Thanks for your help.

What do you mean by this? Is it the file not being created? Or its
blank? Or you get the wrong output? Does it work to print to a screen
device but not a pdf? Etc.

Running the example in ?lordif, this works for me:

pdf("test.pdf")
plot(age.DIF)
dev.off()

What OS are you on and what version of R?

In short, happy to help, but we need (much) more information.

Michael

>
> Debs
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.




More information about the R-help mailing list