[Rd] followup to graphics bug #414

Ben Bolker bolker@zoo.ufl.edu
Mon, 20 Mar 2000 17:20:15 -0500 (EST)


  I haven't been able to compile the development version on my machine yet
(problems with BLAS includes, I don't have time to dig into it right now),
so I'm curious: does this fix also solve the problem recently reported by
Robert Sandefur recently on R-help, where he got different results from
abline() on the X11 and Postscript drivers?  I can replicate his problem
(and perhaps shed some light on it) with the following code--

==========================

tmpf0 <- function(col=1:3,...) {
  p <- matrix(c(3.9,0.2,3.9,0.25,3.9,1.0),byrow=TRUE,ncol=2)
  abline(coef=p[1,],col=col[1],...)
  abline(coef=p[2,],col=col[2],...)
  abline(coef=p[3,],col=col[3],...)
}

tmpf0(3:4)
tmpf0(1:2,p1=c(3.9,0.2),p2=c(3.9,0.25))
tmpf0(1:2,p1=c(3.9,0.2),p2=c(3.9,0.25))

tmpf <- function() {
  plot(1:10,1:10,xlim=c(-3,3),ylim=c(2000,1000000),log="y")
  par(xpd=TRUE)
  tmpf0(lty=1)
  par(xpd=FALSE)
  tmpf0(lty=2)
  par(xpd=NA)
  tmpf0(lty=3)
}

x11()
tmpf()
postscript(file="tmp.ps")
tmpf()
dev.off()
========================

I set this up so that one line (red) would clip at the bottom only, one
line (green) would clip at the bottom and the top, and one line (black)
wouldn't need clipping at all. In R 1.0.0 everything works fine under the
X11 driver but under the Postscript driver, both of the clipped lines are
wrong, but are different depending on how the clipping parameter is set.

  I haven't yet been able to track the source of this down, but I hope
that this information helps if someone gets to it before I do.  If the
recent fix also fixes this bug, that would be very nice.

  Ben Bolker

On Mon, 20 Mar 2000, Paul Murrell wrote:

> hi
> 
> i have committed a fix for this bug into the development version.
> 
> The idea is that, for devices which canClip, R still does some preclipping
> to the device
> extent.  This stops stupidly large numbers being sent to the device, but
> there is a penalty in that two sets of clipping occurs.  Note that this
> preclipping occurs in the graphics engine to  avoid the need for per-device
> checks.  For more information, see the latex file included below.
> 
> paul
> 
> 


-- 
Ben Bolker                                  bolker@zoo.ufl.edu
Zoology Department, University of Florida   http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525                    tel: (352) 392-5697
Gainesville, FL 32611-8525                  fax: (352) 392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._