Peter Crowther
2016-Jan-15 10:41 UTC
[R] R 3.2.3 on Windows 8.1 with interface scaling: how do I produce metafiles that fill the whole canvas?
To reproduce (requires Windows): 1) Set your desktop scaling to 100%; 2) run the script below; 3) observe that the chart in scaled-example.wmf takes up the whole canvas. 4) Set your desktop scaling to greater than 100% (try 150% or 200%); 5) again run the script below; 6) observe that the chart in scaled-example.wmf takes up less than the whole canvas. Increasingly, we're seeing users run R on machines with very high-resolution screens and scaled displays. How can we correct for this effect within R? Cheers, - Peter Script: -- start -- egfr <- c(222.6,176.4) outcome <- data.frame(egfr) hgb <- c(141,134) predictors <- data.frame(hgb) title <- "eGFR vs. Hgb" ylab <- "eGFR" xlab <- "Hgb" gr1<-file.path(path.expand('~'),"scaled-example.wmf") win.metafile(gr1) plot(predictors[[1]],outcome[[1]],main=title,ylab=ylab,xlab=xlab) dev.off() -- end --