Skip to content

ggplot2: edge outlines on points

2 messages · Adam Marsh, Hadley Wickham

#
Hi Adam,

The next version of ggplot2 supports the build-in R plotting symbols
that have different fills and borders, so you can do something like:

geom_point(aes(colour=TRT), fill="red", colour="black", shape=21)

Otherwise in the current version you can do:

ggplot(data.frame(x = runif(20), y = runif(20)), aes(x, y)) +
geom_point(size = 3, colour = "black") +
geom_point(size = 2, colour = "red")

The key difference to your code is that it's all on one plot, and I'm
manually setting the colours, rather than to using scales.  I also
just used a smaller point rather than the matching hollow glyph, which
makes things a little easier (and reverses the orders of the colours).

Hadley
On Wed, Sep 10, 2008 at 9:37 AM, Adam Marsh <amarsh at udel.edu> wrote: