I've noticed that when I add alpha parameter to a geom all text on the graph (axis titles, etc.) get darker (almost as if they have become bold) when output is PDF. This doesn't seem to be tied to the actual alpha value. It makes the 开发者_StackOverflow中文版charts a lot harder on the eyes, particularly when there are multiple charts per page with lots of text. Has anyone else experienced this?
compare the following (probably a bad example because there is little text...but if maximize on the same screen and toggle between them you'll see the difference)
pdf(FILE_HERE1)
p <- ggplot(mtcars, aes(wt, mpg))
p = p + geom_point()
print( p )
dev.off()
pdf(FILE_HERE2)
p <- ggplot(mtcars, aes(wt, mpg))
p = p + geom_point( alpha=.2)
print( p )
dev.off()
Well, this has nothing to do with ggplot2, per se, but how we perceive contrast. In both the plots the text is 59% black (0%=white), and ease of perception in this case comes down to the amount of contrast between the objects. In the first example, the page is 0% black, background grid is 15% black, and plot markers are 100% black. Here, it's relatively easy to distinguish 59% black text when the range is from 0-100% black. In the second plot, not only do you have to perceive the contrast between the plot markers which are only 35% black against a 15% black background grid, but your darkest object is now only 59% black.
My finding is that this has nothing to do with perception, and perhaps something to do with the fact that I'm mixing graphics types: R - adding page numbers to PDF
If I run ghostscript on my PDF then the bold/darker effect disappears. I'm running ghostscript to embed a font into my PDF. A positive side-effect is that my PDFs shrink in size considerably. I know very little about ghostscript, so I'm not sure if this is generalizable or simply a consequence of the specific way I'm using ghostscript.
精彩评论