[R] problem with pdf() R 2.2.1, os 10.4.6

Joerg van den Hoff j.van_den_hoff at fz-rossendorf.de
Sat May 20 15:27:34 CEST 2006


Marc Schwartz wrote:
> On Fri, 2006-05-19 at 16:36 -0700, Betty Gilbert wrote:
>> Hi,
>> I'm trying to write a histogram to a pdf
>>
>> pdf()
>> plot<-hist(c, xlim=c( 0.69, 0.84), ylim=c(0,100))
>>
>> when I try to open the pdf I can't open it, there is always some 
>> error . Is there something I should add to make it run under this 
>> operation system? I had problems upgrading to 2.3 (problem 
>> downloading packages) so I'm not sure an upgrade will work out with 
>> me. I just want a publication quality histogram...
>>
>> thank you,
>> betty
> 
> Betty,
> 
> You need to explicitly close the pdf device with:
> 
>   dev.off()
> 
> once the plotting related code has completed. See the example in ?pdf
> for more information.
> 
> Otherwise, the result of hist() is not flushed to the disk file and the
> file then properly closed.
> 
> HTH,
> 
> Marc Schwartz
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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 maybe you are better off with

plot_something
dev.print(pdf)


with the standard settings of pdf() you get more or less a pdf file 
maintaining the current aspect ratio of the plot on the screen prior to 
the dev.print call



More information about the R-help mailing list