stamp_point: Stamp a point

View source: R/stamp_point.R

stamp_pointR Documentation

Stamp a point

Description

This function adds a point annotation layer

Usage

stamp_point(
  x = 0,
  y = 0,
  size = 8,
  alpha = 1,
  shape = "circle",
  color = "black",
  stroke = 1,
  fill = "grey35",
  xy = NULL
)

Arguments

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

Examples

# 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))

EvaMaeRey/ggstamp documentation built on June 30, 2022, 11 p.m.