[R] weird error from MASS::eqcsplot with postscript driver

Michael Friendly friendly at yorku.ca
Wed Jun 1 21:17:19 CEST 2011


[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,

 > figframe()
Error in if (yuin > xuin * ratio) yuin <- xuin * ratio else xuin <- 
yuin/ratio :
   missing value where TRUE/FALSE needed
 > traceback()
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

-- 
Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA



More information about the R-help mailing list