Adds one or more reference lines or segments to a plot. Dispatches to the appropriate ggplot2 geom based on the parameters supplied:
Usage
mark_rule(
plot,
xintercept = NULL,
yintercept = NULL,
slope = NULL,
intercept = NULL,
x = NULL,
xend = NULL,
y = NULL,
yend = NULL,
colour = NULL,
linetype = NULL,
linewidth = NULL,
...,
rasterize = FALSE,
rasterize_dpi = 300,
rasterize_dev = "cairo"
)Arguments
- plot
A plotit object
- xintercept
x-intercept for vertical line(s)
- yintercept
y-intercept for horizontal line(s)
- slope
Line slope for abline
- intercept
Line intercept for abline
- x
Start x coordinate(s) for segment
- xend
End x coordinate(s) for segment
- y
Start y coordinate(s) for segment
- yend
End y coordinate(s) for segment
- colour
Line colour
- linetype
Line type
- linewidth
Line width in mm
- ...
Other arguments passed to the underlying geom
- rasterize
If
TRUE, rasterize viaggrastr::rasterise().- rasterize_dpi
DPI for rasterization (default 300).
- rasterize_dev
Graphics device for rasterization (default
"cairo").
Details
xintercept→ ggplot2::geom_vlineyintercept→ ggplot2::geom_hlineslope+intercept→ ggplot2::geom_ablinex/xend/y/yend→ ggplot2::geom_segment
Dispatch priority: vline/hline > abline > segment.
