Symbols in pdf plot

52 views
Skip to first unread message

Ian Saunders

unread,
Sep 3, 2012, 11:12:28 PM9/3/12
to ggp...@googlegroups.com
I'm drawing a simple point graph, with the symbol size increased to make it clearer.
 
All is well when I show the plot on screen in windows() or save it to a png file with png(), but when I use pdf(), the size of the round symbol is much smaller than the other symbols.
 
This is a sample of code:
data <- data.frame(x=1:12,y=1:12,col=factor(rep(1:3,4)),shape=factor(rep(1:4,3)))
g <- ggplot(data,aes(x=x,y=y))
print( g+geom_point(aes(colour=col,shape=shape),size=5) )
Am I missing something or is this a bug? The same happens with pdf() in windows and in linux.
 
Thanks
Ian.
 
 
plot.png
plot.pdf

Winston Chang

unread,
Sep 3, 2012, 11:44:38 PM9/3/12
to Ian Saunders, ggp...@googlegroups.com
The pdf and png file you supplied look pretty much the same to me on
my Mac with Preview.app and with Adobe Reader. It's possible that the
issue is your PDF renderer.

By default, R uses the Zapf Dingbats font to represent some point
shapes, and this can occasionally cause problems. Try turning it off
with this:
pdf("file.pdf", useDingbats=FALSE)

-Winston
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2

Ian Saunders

unread,
Sep 4, 2012, 5:52:23 PM9/4/12
to ggp...@googlegroups.com, Ian Saunders
Thanks, Winston. Yes, that was it. Coincidentally I had my computer upgraded to Windows 7 and a new version of Adobe Reader and the plot looks fine now.
All the best
Ian.
Reply all
Reply to author
Forward
0 new messages