| stamp_point | R Documentation |
This function adds a point annotation layer
stamp_point( x = 0, y = 0, size = 8, alpha = 1, shape = "circle", color = "black", stroke = 1, fill = "grey35", xy = NULL )
x |
numeric x position, defaults to 0 |
y |
numeric y position, defaults to 0 |
size |
a scalar or vector numeric |
alpha |
numeric between 0 and 1 indicating transparency, defaults to 1 fully opaque, zero is fully transparent |
shape |
a numeric or character string, "circle" is default but also try "star", "bullet", "diamond", "triangle" |
color |
a character string indicating color, defaults to "black", for other named colors check out https://evamaerey.github.io/ggplot2_grammar_guide/named_colors |
stroke |
a numeric - size of shape outline |
# stamp in plot space
library(ggplot2)
ggplot(cars) +
aes(speed, dist) +
geom_point() +
stamp_point() +
stamp_point(color = "red", x = 10, y = 100)
# more points on canvas
ggcanvas() +
stamp_point(color = "darkgreen") +
stamp_point(x = 1:5, y = 2,
size = 8, alpha = .5) +
stamp_point(xy = pos_wrap(y0 = -2,
n = 13, ncol = 4),
color = "plum") +
stamp_point(xy = pos_wrap(x0 = 1,
n = 7, ncol = 4, width = .5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.