neversaint
neversaint

Reputation: 64004

Howto set paper size using postscript() to make it same with pdf() in R

I have already successfully plot a figure using this command:

pdf("myplot.pdf",paper="a4",height=20.0)

The figures are well placed with the proper size orientation and size. But when I convert it to postcript with the same parameter, it goes wrong.

postscript("myplot.eps",paper="a4",height=20.0)

What's the correct way to set the parameter in postscript() so that it generate the same format as pdf()?

Upvotes: 1

Views: 295

Answers (1)

agstudy
agstudy

Reputation: 121568

I recommend you really to use knitr. One of the motivation of the package is :

I wished for many times that if only I could use graphics devices other than PDF and postscript; now the dream has come true in the official R, but what I was hoping for was an option as simple as dev = 'png' or dev = 'CairoJPEG'.

For example you can create a chunck

<<dev='postscript'>>=
   plot(cars)  ##replace this by your code to create myplot
@

Upvotes: 1

Related Questions