[R] ggplot2: edge outlines on points

Adam Marsh
Wed, 10 Sep 2008 14:37:23 -0000

The graphic design elements in ggplot2 are so well done for color
graphics. Thank you! For BW publication graphs, there are a few
options I would like to be able to tweak, but can't seem to find the
grob handles necessary OR the right plotting strategy. Here's one
problem I've been puzzling over:

Q> How do you plot points with a grey fill and a black outline around
the edge?

I haven't been able to find the MatLab equivalent of
"MarkerEdgeColor" so
I've been working on trying to overlay two plots of the same points,
one plotted with fills and the other plotted with edge outlines (here
is my conceptual  code):

pfill <- ggplot(data=DF, aes(x=X, y=Y)) +
             geom_point(aes(colour=TRT),size=4) +
             scale_colour_grey(end=0.8) +
             theme_bw

pedge <- ggplot(data=DF, aes(x=X, y=Y)) +
             geom_point(aes(colour=TRT),size=4) +
             scale_colour_grey(end=0.8) +
             scale_shape(solid=FALSE) +
             theme_bw

However, I can't figure out the correct syntax, if this is even the
right way to go about it. Any suggestions as to the best approach to
achieve filled points with an edge outline would be greatly appreciated.


---------------------------------------------------
Adam G. Marsh, Ph.D.
Associate Professor
Marine Biological Sciences
University of Delaware
Lewes, DE 19958
302.645.4367
------------------------------------------------





	[[alternative HTML version deleted]]