--0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C Content-type: text/plain; charset=us-ascii The attached script produces "Error in plot.xy ... negative length vectors are not allowed" when using pdf() but not when using postscript (). platform sparc-sun-solaris2.8 arch sparc os solaris2.8 system sparc, solaris2.8 status major 1 minor 3.1 year 2001 month 08 day 31 language R (See attached file: test.zip) --0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C Content-type: application/zip; name="test.zip" Content-Disposition: attachment; filename="test.zip" Content-transfer-encoding: base64 UEsDBAoABAAGAF1Rbyvc25I/oAEAAMoCAAAGAAAAdGVzdC5ySihtBP1NAw0FDQgtFAcIBAgFDQgV OA0ILQgFLQgdBxZNBy0HDTdNBg0GBx0EBgQFAwQFFB0EBQQTBxQDFwYFFx0OB/7+/v7+/v7OPxMR AgQFBAoUOgQ6AwRKuwSrBDsEiwoAEgYXBhcG9/f3V1GiJfxAg/kRI0dIXNe+ECavWR+2HnZ7678k pz9OP3b+sT+65uHHGbkcsk4/48wcf8mzZKIn53XNjJu8chi5L+5X7gLpRdnb/i8GPf+T6WkF5cXp x7SZ3WUDKwQx/e616W5n8/n5v6Z86//nlrscqvZsdPFOiX53qzbUrffYZBMCiRopcfq3fn3bPE4J 9mes/pLqqxuTHZbclJ+nnxqrbPXOEvgU5Cx8TVXNq9O7W5R6XuvyhePLjC+18H3L4btJ/aW56a9c PHJx8w/5Ra2Zxccyx+D8L+QHN9zX9+3QvnqX8fm4eR0dHJalubj1NHezzKZ/hi6bC3pez22J/0s5 ntOEdlpO380LygOnP9wmW6xepqjOwcI/2O9ot2AGVoMC8VEOxeUmPklX4+naoSzcXs72vAJQSwME CgAEAAYAJEdvK2WnKv6sAAAAOgEAAAgAAAB0ZXN0LmRhdBmaAxr7+wsCCxMCAwJD+/v7+/v7+/v7 +/v7WwgCAAEDOPn5+XkGAAEW9/f3t/FrqrPfx8bI/ZwZWb8cI8vXMnv+3dnT91IZl8rI+GMVb1Qc 540/hmRk6YpTx2T/URhtiLcoLitqunn3g/x964yuov4VmRXnqBiR7UdXjIgot7/I6CKusEJ4GVlI LZiYFU2DEWX1aFTwePvjGDEq7qtoUnxN0cxr64qS2pYU8wRQSwECCgMKAAQABgBdUW8r3NuSP6AB AADKAgAABgAAAAAAAAAAAAAApIEAAAAAdGVzdC5yUEsBAgoDCgAEAAYAJEdvK2WnKv6sAAAAOgEA AAgAAAAAAAAAAAAAAKSBxAEAAHRlc3QuZGF0UEsFBgAAAAACAAIAagAAAJYCAAAAAA= --0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C-- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Could you re-send it in a form we can actually read? No mailer I have (even on Solaris) can unscramble this. I don't think R-bugs is scrambling this, but we know attachments are a pain in the archive. On Thu, 15 Nov 2001 White.Denis@epamail.epa.gov wrote:> --0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C > Content-type: text/plain; charset=us-ascii > > The attached script produces "Error in plot.xy ... negative length > vectors are not allowed" when using pdf() but not when using postscript > (). > > platform sparc-sun-solaris2.8 > arch sparc > os solaris2.8 > system sparc, solaris2.8 > status > major 1 > minor 3.1 > year 2001 > month 08 > day 31 > language R > > (See attached file: test.zip) > --0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C > Content-type: application/zip; > name="test.zip" > Content-Disposition: attachment; filename="test.zip" > Content-transfer-encoding: base64 > > UEsDBAoABAAGAF1Rbyvc25I/oAEAAMoCAAAGAAAAdGVzdC5ySihtBP1NAw0FDQgtFAcIBAgFDQgV > OA0ILQgFLQgdBxZNBy0HDTdNBg0GBx0EBgQFAwQFFB0EBQQTBxQDFwYFFx0OB/7+/v7+/v7OPxMR > AgQFBAoUOgQ6AwRKuwSrBDsEiwoAEgYXBhcG9/f3V1GiJfxAg/kRI0dIXNe+ECavWR+2HnZ7678k > pz9OP3b+sT+65uHHGbkcsk4/48wcf8mzZKIn53XNjJu8chi5L+5X7gLpRdnb/i8GPf+T6WkF5cXp > x7SZ3WUDKwQx/e616W5n8/n5v6Z86//nlrscqvZsdPFOiX53qzbUrffYZBMCiRopcfq3fn3bPE4J > 9mes/pLqqxuTHZbclJ+nnxqrbPXOEvgU5Cx8TVXNq9O7W5R6XuvyhePLjC+18H3L4btJ/aW56a9c > PHJx8w/5Ra2Zxccyx+D8L+QHN9zX9+3QvnqX8fm4eR0dHJalubj1NHezzKZ/hi6bC3pez22J/0s5 > ntOEdlpO380LygOnP9wmW6xepqjOwcI/2O9ot2AGVoMC8VEOxeUmPklX4+naoSzcXs72vAJQSwME > CgAEAAYAJEdvK2WnKv6sAAAAOgEAAAgAAAB0ZXN0LmRhdBmaAxr7+wsCCxMCAwJD+/v7+/v7+/v7 > +/v7WwgCAAEDOPn5+XkGAAEW9/f3t/FrqrPfx8bI/ZwZWb8cI8vXMnv+3dnT91IZl8rI+GMVb1Qc > 540/hmRk6YpTx2T/URhtiLcoLitqunn3g/x964yuov4VmRXnqBiR7UdXjIgot7/I6CKusEJ4GVlI > LZiYFU2DEWX1aFTwePvjGDEq7qtoUnxN0cxr64qS2pYU8wRQSwECCgMKAAQABgBdUW8r3NuSP6AB > AADKAgAABgAAAAAAAAAAAAAApIEAAAAAdGVzdC5yUEsBAgoDCgAEAAYAJEdvK2WnKv6sAAAAOgEA > AAgAAAAAAAAAAAAAAKSBxAEAAHRlc3QuZGF0UEsFBgAAAAACAAIAagAAAJYCAAAAAA=> > --0__=88256B050063F04C8f9e8a93df938690918c88256B050063F04C-- > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley@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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The attached script produces "Error in plot.xy ... negative length vectors are not allowed" when using pdf() but not when using postscript (). platform sparc-sun-solaris2.8 arch sparc os solaris2.8 system sparc, solaris2.8 status major 1 minor 3.1 year 2001 month 08 day 31 language R ------------------------------------ # script PDF <- TRUE f.v1 <- function (x, a, b) b * (x^a) f.v2 <- function (x, a, b, d) b * (x^a) * exp(d*x) dat <- scan ("test.dat") if (PDF) pdf ("test.pdf", width=8.5, height=11) else postscript ("test.eps", horizontal=FALSE, onefile=FALSE) par (mfrow=c(2,1), mar=rep(6,4)) n <- length(dat) nseq <- seq (n) fit <- lm (log (dat[nseq]) ~ log (nseq)) b <- exp (fit$coefficients[1]) a <- fit$coefficients[2] plot (dat[nseq], pch=20) points (sapply (nseq, f.v1, a, b), col="red", pch=20) fit <- lm (log (dat[nseq]) ~ log (nseq) + nseq) b <- exp (fit$coefficients[1]) a <- fit$coefficients[2] d <- fit$coefficients[3] plot (dat[nseq], pch=20) points (sapply (nseq, f.v2, a, b, d), col="red", pch=20) graphics.off () ----------------------------------- # data set 9.585 12.935 14.775 15.625 16.56 17.44 18.165 18.655 19.04 19.49 19.9 20.285 20.61 20.815 21.065 21.3 21.46 21.645 21.82 22.085 22.315 22.45 22.61 22.67 22.79 22.9 23.01 23.1 23.165 23.295 23.4 23.51 23.585 23.64 23.685 23.75 23.805 23.84 23.9 23.955 24.025 24.09 24.14 24.18 24.23 24.275 24.31 24.33 24.345 24.37 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Once again, this has nothing to do with pdf()! The bug is in the internal clipping code in graphics.c, which read default: /* Partial clipping; draw poly[line|gon] */ dd->gp.xpd = 2; result2 = clipCircleCode(x, y, coords, ir, dd); dd->gp.xpd = xpdsaved; if (dd->dp.canClip && result2 == -2) { GClip(dd); dd->dp.circle(x, y, coords, ir, bg, fg, dd); } else { vmax = vmaxget(); xc = (double*)R_alloc(result+1, sizeof(double)); yc = (double*)R_alloc(result+1, sizeof(double)); with result, not result2. This meant that if a circle was clipped by the plot region but not by the device region, result got set to -2, and the final lines tried to allocate a vector of size -1. As the postscript device has dd->dp.canClip true, the bug was avoided on that device. I don't fully understand the intended logic: is this fix the correct one, Paul or Ross? And can we have some comments in the code, please? On Thu, 15 Nov 2001 White.Denis@epamail.epa.gov wrote:> The attached script produces "Error in plot.xy ... negative length > vectors are not allowed" when using pdf() but not when using postscript > (). > > platform sparc-sun-solaris2.8 > arch sparc > os solaris2.8 > system sparc, solaris2.8 > status > major 1 > minor 3.1 > year 2001 > month 08 > day 31 > language R > > ------------------------------------ > # script > PDF <- TRUE > > f.v1 <- function (x, a, b) b * (x^a) > f.v2 <- function (x, a, b, d) b * (x^a) * exp(d*x) > > dat <- scan ("test.dat") > > if (PDF) pdf ("test.pdf", width=8.5, height=11) else > postscript ("test.eps", horizontal=FALSE, onefile=FALSE) > > par (mfrow=c(2,1), mar=rep(6,4)) > > n <- length(dat) > nseq <- seq (n) > > fit <- lm (log (dat[nseq]) ~ log (nseq)) > b <- exp (fit$coefficients[1]) > a <- fit$coefficients[2] > plot (dat[nseq], pch=20) > points (sapply (nseq, f.v1, a, b), col="red", pch=20) > > fit <- lm (log (dat[nseq]) ~ log (nseq) + nseq) > b <- exp (fit$coefficients[1]) > a <- fit$coefficients[2] > d <- fit$coefficients[3] > plot (dat[nseq], pch=20) > points (sapply (nseq, f.v2, a, b, d), col="red", pch=20) > > graphics.off () > > ----------------------------------- > # data set > 9.585 > 12.935 > 14.775 > 15.625 > 16.56 > 17.44 > 18.165 > 18.655 > 19.04 > 19.49 > 19.9 > 20.285 > 20.61 > 20.815 > 21.065 > 21.3 > 21.46 > 21.645 > 21.82 > 22.085 > 22.315 > 22.45 > 22.61 > 22.67 > 22.79 > 22.9 > 23.01 > 23.1 > 23.165 > 23.295 > 23.4 > 23.51 > 23.585 > 23.64 > 23.685 > 23.75 > 23.805 > 23.84 > 23.9 > 23.955 > 24.025 > 24.09 > 24.14 > 24.18 > 24.23 > 24.275 > 24.31 > 24.33 > 24.345 > 24.37 > > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley@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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._