stamp_hline: Stamp a horizontal line, a wrapper for geom_hline

View source: R/stamp_hline.R

stamp_hlineR Documentation

Stamp a horizontal line, a wrapper for geom_hline

Description

Stamp a horizontal line, a wrapper for geom_hline

Usage

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

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

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