I think this might be related to an update to ggplot2
, but could also be something on my system. Trying to track down the cause. I get hollow rectangles when using the pdf()
output device, and [expected] solid circles when using png()
.
This is on arch linux; should I be looking for an change in ggplot2
, something new in R
in general, or some backend on my system that's used to generate these outputs? I don't know what's all involved but it's new behavior to me.
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.1.0
loaded via a namespace (and not attached):
[1] labeling_0.3 colorspace_1.2-6 scales_0.4.0 plyr_1.8.4
[5] gtable_0.2.0 Rcpp_0.12.6 grid_3.3.1 munsell_0.4.3
Some test code:
library(ggplot2)
dat <- data.frame(x = 1:10, y = (1:10)^2)
p <- ggplot(dat, aes(x = x, y = y)) + geom_point()
Comparison screenshots
Output on R graphics device:
p
Output to png()
device:
png("./test.png", width = 1600, height = 900, res = 150)
p
dev.off()
Output to pdf()
device (viewed with evince
, though gimp
shows the same):
pdf("./test.pdf", width = 9, height = 6)
p
dev.off()
Hunting
I did look around a bit and didn't find any obvious hits for "ggplot2 using squares instead of circles pdf" or similar on google.
I also perused the version 2 changelog and searched the page for "point" and "shape". I see a reference to a switch from pch
19 instead of 16, but both of those are solid circles.
Looking at various google image hits for incantations of "ggplot2 geom_point pdf", "ggplot2 geom_point hollow" and similar didn't show anything obvious (unless the user appeared to be trying to get hollow shapes and specifying non-default pch
values via shape
).