Produces a standalone SVG image of a plot. SVG is a vector format, so the result is resolution independent: it stays sharp at any size or zoom level, which is what makes it suitable both for the web and for print.
Arguments
- plot
An
orb_specobject.- width, height
Size in pixels.
- interactive
Embed JavaScript for tooltips, hover highlighting, zoom, pan and legend toggling. Set
FALSEfor a static image, for example when embedding in a document that forbids scripts.- id
Element id used by the embedded script; generated if
NULL.
Examples
p <- orb(mtcars, x = wt, y = mpg) + orb_points()
s <- orb_svg(p, interactive = FALSE)
substr(s, 1, 40)
#> [1] "<svg xmlns=\"http://www.w3.org/2000/svg\" "