[R] maximum width for pdf device

Marc Schwartz MSchwartz at medanalytics.com
Wed Nov 19 23:04:47 CET 2003


On Wed, 2003-11-19 at 15:21, Prof Brian Ripley wrote:
> On Wed, 19 Nov 2003, Vince Forgetta wrote:
> 
> > What is (or how to I change) the maximum width of a pdf image. I am 
> > trying to make a pdf image:
> > 
> > pdf(file="out.pdf",width=200,height=20)
> > 
> > and I can't get the image to be more that 200 inches wide i.e. I get
> an 
> > empty out.pdf . Is there a solution around this.
> 
> There is no such limit, and I don't get an empty file.  Are you _sure_
> the
> limit is not in your own software, that is in e.g. acrobat?  It seems
> acrobat does have a 200" width limit, but other viewers do work.


One quick follow up thought.

Are you remembering to call dev.off() after your plot?  If you don't,
depending upon the nature of your plot, the pdf file will be empty since
the graphic content will not be flushed to the file until the device is
closed.

Try this:

pdf(file="out.pdf", width = 200, height = 20)
barplot(1:10)
dev.off()

and then look at the file.

I can view that file just fine with Acrobat 5 under Fedora Core 1 as
well as the other pdf viewers.

HTH,

Marc Schwartz




More information about the R-help mailing list