R/helpers_gghistostats_graphics.R
line_labeller.Rd
Adds a label to the horizontal or vertical line.
line_labeller( plot, x, y, k = 2, label.text, label.args = list(), line.direction = "vline", jitter = 0.25, ... )
plot | A |
---|---|
x, y | The |
k | Number of digits after decimal point (should be an integer)
(Default: |
label.text | The text to include in the label (e.g., |
label.args | A list of additional aesthetic arguments to be
passed to |
line.direction | Character that specifies whether the line on which
label is to be attached is vertical ( |
jitter | Numeric that specifies how much the label should be jittered in
the vertical direction (default: |
... | Currently ignored. |
# creating a basic plot set.seed(123) library(ggplot2) p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() # adding a label ggstatsplot:::line_labeller( plot = p, x = median(mtcars$wt), y = mean(mtcars$mpg), k = 2, label.args = list(color = "red"), label.text = "median" )