Using an SVG icon from the web
This example grabs an SVG from the internet and then uses it as a
plotting glyph without further modification.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Read SVG from the web
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
car_url <- 'https://www.svgrepo.com/download/114837/car.svg'
car_svg <- paste(readLines(car_url), collapse = "\n")
grid::grid.draw( svg_to_rasterGrob(car_svg) )
ggplot(mtcars) +
geom_point_svg(
aes(mpg, wt),
svg = car_svg,
size = 8
) +
theme_bw()