R/stamp_vline.R

Defines functions stamp_vline

Documented in stamp_vline

#' Horizontal line, wraps geom_vline w defaut at y = 0
#'
#' @param xintercept x position of vertical line
#'
#' @inheritParams stamp_hline
#'
#' @return
#' @export
#'
#' @examples
#' library(ggplot2)
#' ggplot(cars) +
#' aes(speed, dist) +
#' geom_point() +
#' stamp_vline()
#'
#' # on a canvas
#' ggcanvas() +
#' stamp_vline(color = "cadetblue") +
#' stamp_vline(0:5,
#'            linetype = rep(c("dotted", "dashed"), 3))
stamp_vline <- function(xintercept = 0,
                        alpha = 1,
                        color = "black",
                        linetype = "solid",
                        size = 1.5){

  ggplot2::geom_vline(xintercept = xintercept,
                      alpha = alpha,
                      color = color,
                      linetype = linetype,
                      size = size)
}
EvaMaeRey/ggstamp documentation built on June 30, 2022, 11 p.m.