## Paul Johnson ## 2012-08-10 ## ## I've got trouble with a mis-match between screen and pdf devices. ## Please run this and tell me if the point z's "marker" is on the ## intersection of the 2 circles for you. ## Why do I ask? On my Dell M4600 laptop, the marker (the pch=12) is ## on the intersection in the x11 device. See the screenshot: ## ## http://pj.freefaculty.org/scraps/testSymbol-01.png ## ## But the pdf output of same is not ## ## http://pj.freefaculty.org/scraps/testSymbol.pdf ## ## Notice one other weird thing. The circle sizes change. Maybe ## that's just the same weird thing. ## The X11 device is 7in x 7in. Right? Same as pdf. ## Why would coordinates from locator work in one display, but not the ## other? I've abused the symbols function somehow? locator is device ## dependant? ## Maybe its the video driver & LCD. ## This is a Dell Precision M4600. The LCD display is 13.6 inches x ## 7.6 inches (345.4mm x 193mm). By my reckoning, it is not precisely ## 16:9. The Nvidia card says the native resolution is 1920x1080, ## which is exactly 16:9. saveFile <- FALSE if(saveFile){ pdf(file="testSymbol.pdf", onefile=FALSE, paper="special", height = 7, width = 7) } plot(c(0,1), c(0,1), type = "n", xlab = "", ylab = "") x <- c(0.3, 0.3) y <- c(0.7, 0.7) points(x[1], x[2]) points(y[1], y[2]) symbols(x[1], x[2], circles=c(0.3), lty=2, inches = FALSE, add=TRUE) symbols(y[1], y[2], circles=c(0.3), lty=2, inches = FALSE, add=TRUE) ##Here's what I get from locator(1) on the intersection z <- list(x=0.4028, y=0.6485) if (is.null(z)) z <- locator(1) ## click on intersection of lines points(z, pch=12) text(x =0.96*z[[1]], y = 1.05*z[[2]], label="z") dev.off()