[Env: R 2.12.2, Win XP]
I'm creating figures using MASS::eqcsplot to provide equal scaling of
the axes. My figures work OK
when I plot to the screen, but when I try to do the same plot as a
postscript file, I get an
unexplicable error,
Error in if (yuin > xuin * ratio) yuin <- xuin * ratio else xuin <-
yuin/ratio :
missing value where TRUE/FALSE needed
2: eqscplot(x = 0, y = 0, xlim = xlim, ylim = ylim, xlab = xlab,
ylab = ylab, type = "n")
1: figframe()
Here is a minimal source script exhibiting the problem:
library(MASS)
eps <- function(file="Rplot.eps", horizontal=FALSE, paper="special",
...) {
postscript(file=file, onefile=FALSE, horizontal=horizontal,
paper=paper, ...)
}
# Figure frame
figframe <- function( xlim = c(-3,3), ylim = c(-3,3), xlab = '', ylab
= '') {
eqscplot( x=0,y=0, xlim = xlim, ylim = ylim, xlab = xlab, ylab =
ylab, type = 'n')
abline( v=0, col="gray")
abline( h=0, col="gray")
}
# screen: OK
op <- par(mar=c(3, 3, 1, 1) + 0.4)
figframe()
par(op)
# eps: fails
eps(file="test1.eps")
op <- par(mar=c(3, 3, 1, 1) + 0.4)
figframe()
par(op)
dev.off()
I know this worked under an earlier version, probably ~ R 2.9.x