library(ggplot2)
# Create a simple plot
p <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point()
# Use draw() to insert the plot into an SVG template
input_svg <- system.file("examples", "Template.svg", package = "svgedit")
draw(
input_svg = input_svg,
output_svg = tempfile(fileext = ".svg"),
plots = list(panel_A = p)
)
Run the code above in your browser using DataLab