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? -- Robin K. S. Hankin, Lecturer, School of Geography and Environmental Science Tamaki Campus Private Bag 92019 Auckland New Zealand r.hankin at auckland.ac.nz tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 as of: Fri Dec 13 11:07:00 NZDT 2002 This (linux) system up continuously for: 470 days, 16 hours, 49 minutes
Hi Does par(pty="s") do the trick? (setting the width and height of the device typically won't make the plot square because the margins around the plot are typically not equal) Paul Robin Hankin wrote:> > 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? > > -- > > Robin K. S. Hankin, Lecturer, > School of Geography and Environmental Science > Tamaki Campus > Private Bag 92019 Auckland > New Zealand > > r.hankin at auckland.ac.nz > tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 > > as of: Fri Dec 13 11:07:00 NZDT 2002 > This (linux) system up continuously for: 470 days, 16 hours, 49 minutes > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz
ripley@stats.ox.ac.uk
2002-Dec-13 07:58 UTC
[R] width and length arguments to postscript()
There are lots of examples in MASS of doing this for spatial data. Use eqscplot (from MASS) with type="n", then contour(add=T) On Fri, 13 Dec 2002, Robin Hankin wrote:> 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? > > -- > > Robin K. S. Hankin, Lecturer, > School of Geography and Environmental Science > Tamaki Campus > Private Bag 92019 Auckland > New Zealand > > r.hankin at auckland.ac.nz > tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 > > as of: Fri Dec 13 11:07:00 NZDT 2002 > This (linux) system up continuously for: 470 days, 16 hours, 49 minutes > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595