draw_points {ggsem} | R Documentation |
Draw Points on a ggplot Object
Description
This function overlays points to a ggplot object using data from a CSV file generated by the ggsem Shiny app or any custom dataset. Points can be styled with various shapes, colors, sizes, and orientations.
Usage
draw_points(p, points_data, zoom_level = 1)
Arguments
p |
A ggplot object to which the points will be added. |
points_data |
A data frame containing information about the points to be drawn. The expected columns include:
|
zoom_level |
Numeric. Adjusts the size of the points relative to the plot. Default is |
Value
A ggplot object with the specified points added.
Examples
library(ggplot2)
points_data <- data.frame(
x = 20, y = 20, shape = 'rectangle', color = '#D0C5ED', size = 50,
border_color = '#9646D4', border_width = 2, alpha = 1, width_height_ratio = 1.6, orientation = 45,
lavaan = FALSE, lavaan = FALSE, network = FALSE, locked = FALSE
)
p <- ggplot()
draw_points(p, points_data, zoom_level = 1.2) +
scale_x_continuous(limits = c(0,50)) +
scale_y_continuous(limits = c(0,50))