Write text annotations from an annotation CSV file (from ggsem Shiny app) on a ggplot object
Source:R/draw_annotations.R
draw_annotations.Rd
This function adds text annotations onto any ggplot output (including your own plots not created from the ggsem Shiny app).
Examples
library(ggplot2)
annotations_data <- data.frame(
text = 'Square One', x = 26, y = 300, font = 'serif',
size = 20, color = '#000000', angle = 0, alpha = 1,
fontface = 'bold', math_expression = FALSE,
lavaan = FALSE
)
p <- ggplot(mtcars) + geom_point(aes(mpg, disp))
draw_annotations(p, annotations_data, zoom_level = 1.2)