I would like to use vector graphics stored in external files (e.g. SVG) as my plotting symbols in a ggplot2
figure. e.g. following this example from the grImport vignette (Fig. 8) https://cran.r-project.org/web/packages/grImport/vignettes/import.pdf
This example imports a custom shapefile and then plots it using lattice
e.g.
xyplot(V8 ~ V7, data = flower, xlab = "Height",
ylab = "Distance Apart",
panel = function(x, y, ...) {
grid.symbols(PSflower, x, y, units = "native",
size = unit(5, "mm"))})
with grid.symbols()
coming from the grImport
package and PSflower
being a Picture object imported elsewhere by grImport
.
The ggimage
package gets close to doing this, but it converts the image to a raster below plotting, which is what I'm trying to avoid.
Is there any way I could implement something similar in ggplot2
?
Mark