Skip to contents

Add a horizontal (using yintercept) or vertical (using xintercept) reference line.

Usage

acid_geom_abline(xintercept = NULL, yintercept = NULL)

Arguments

xintercept, yintercept

numeric(1). Value denoting x- or y-axis cutoff. Use either xintercept or yintercept, but not both.

Value

Layer/ggproto.

Note

Updated 2023-08-10.

Examples

## x-axis line.
geom <- acid_geom_abline(xintercept = 1L)
print(geom)
#> mapping: xintercept = ~xintercept 
#> geom_vline: na.rm = FALSE
#> stat_identity: na.rm = FALSE
#> position_identity 

## y-axis line.
geom <- acid_geom_abline(yintercept = 1L)
print(geom)
#> mapping: yintercept = ~yintercept 
#> geom_hline: na.rm = FALSE
#> stat_identity: na.rm = FALSE
#> position_identity