Add Horizontal Arrow with Text Label to a ggplot
add_h_arrow(
p,
x,
y,
label = "optimal number",
space = 0.01,
vjust = 0.3,
seg_len = 0.1,
arrow_len = unit(2, "mm"),
arrow_type = c("closed", "open"),
font_size = 5,
font_family = c("serif", "sans", "mono"),
font_face = c("plain", "bold", "italic")
)
a ggplot
object.
a ggplot
.
position at x axis.
position at y axis.
text label.
a small space between arrow and text.
vertical adjustment, set to 0 to align with the bottom, 0.5 for the middle, and 1 (the default) for the top.
length of the arrow segment.
length of the arrow.
type of the arrow.
font size.
font family.
font face.