This is useful primarily for testing. Requires the xml2 package.
xmlSVG(code, ..., standalone = FALSE, height = 7, width = 7)Plotting code to execute.
Other arguments passed on to svgstring.
Produce a standalone svg file? If FALSE, omits
xml header and default namespace.
Height and width in inches.
A xml2::xml_document object.
if (require("xml2")) {
x <- xmlSVG(plot(1, axes = FALSE))
x
xml_find_all(x, ".//text")
}
#> Loading required package: xml2
#> {xml_nodeset (2)}
#> [1] <text x="266.40" y="485.28" text-anchor="middle" style="font-size: 12.00p ...
#> [2] <text transform="translate(12.96,244.80) rotate(-90)" text-anchor="middle ...