powered by
Draw a square bracket with a label on a ggplot
bracket( xmin = NULL, xmax = NULL, ymin = NULL, ymax = NULL, vertical = NULL, horizontal = NULL, open = NULL, bracket_shape = NULL, thickness = 2, bracket_color = "black", label = NULL, label_hjust = NULL, label_vjust = NULL, label_font_size = 5, label_font_face = "bold", label_color = "black", label_parse = FALSE )
a ggplot object; there will be no meaningful output from this function. Instead, this function should be used with another ggplot object
xmin
xmax
ymin
ymax
vertical
horizontal
open
bracket_shape
thickness
bracket_color
label
label_hjust
label_vjust
label_font_size
label_font_face
label_parse
# \donttest{ library(ggplot2) ggplot(mtcars, aes(x = cyl, y = mpg)) + geom_point() + bracket(6.1, 6.2, 17, 22, bracket_shape = "]", label = "abc") # }
Run the code above in your browser using DataLab