Skip to content
Prev 26240 / 398502 Next

width and length arguments to postscript()

Hi everyone

This must be a FAQ but I can't find it anywhere...

I want a postscript image of a contour() plot, with axes of equal
length. Try

R> postscript(file="~/f.ps")
R> contour(matrix(rnorm(100),10,10))
R> dev.off()

This isn't what I want: the plotting region is, as documented, quarter
of an inch shy of the paper edge and the axes appear to be different
lengths.  contour() doesn't take a "asp" argument.

postscript() does have a width and a length argument but I can't make
them work as I want:

R> postscript(file="~/f.ps",width=5,height=5)
R> contour(matrix(rnorm(100),10,10))
R> dev.off()

gives axes of about 96mm by 80mm (on A4 paper).

What do I have to do to get square contour plots on a postscript file?