View source: R/geom_outline_point.R
geom_outline_point | R Documentation |
This is a variant of the point geom, wherein overlapping points are given a shared outline. It works by drawing an additional layer of points below a regular layer of points with a thicker stroke.
geom_outline_point(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Due to the way this geom is implemented, it handles the alpha
aesthetic pretty ungracefully.
A ggplot Layer
geom_outline_point()
understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
fill
group
shape
size
stroke
stroke_colour
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
# A standard plot
p <- ggplot(mpg, aes(displ, cty, colour = factor(cyl))) +
geom_outline_point(size = 10, stroke = 3)
p
# The colour of the stroke can be mapped to a scale by setting the
# aesthetics to `"stroke_colour"`.
p +
aes(stroke_colour = factor(cyl)) +
scale_colour_hue(
aesthetics = "stroke_colour",
l = 50
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.