Stamp a horizontal line, a wrapper for geom_hline

stamp_hline(
  yintercept = 0,
  alpha = 1,
  color = "black",
  linetype = "solid",
  size = 1.5
)

Arguments

yintercept

numeric indicating yintercept, default to 0

alpha

numeric between 0 and 1 indicating transparency, defaults to 1 fully opaque, zero is fully transparent

color

a character string indicating color, defaults to "black", for other named colors check out https://evamaerey.github.io/ggplot2_grammar_guide/named_colors

linetype

a string indicating linetype, "solid", "dashed", "dotted", defaults to "solid"

size

numeric value indicating line width, defaults to 1.5

Value

Examples

library(ggplot2) ggplot(cars) + aes(speed, dist) + stamp_hline()
# on a canvas ggcanvas() + stamp_hline() + stamp_hline(1:6, linetype = rep(c("dotted", "dashed"), 3))