I am using svglite to save SVG files of R plots.
I get SVG files that have height and width in them. Unless I really misunderstand the docs, this is not what I expect.
https://svglite.r-lib.org/articles/scaling.html
The SVG files produced by svglite do not include width and height properties.
Possibly I am doing something stupid as I don't understand R graphics devices. I am running svglite 2.1, r 4.1.2, Rstudio 2022.07.1, on windows 10.
When I run this, basically the same as the svglite sample code:
svglite::svglite(filename = "C:/temp/ggplot.svg")
plot(1:10)
dev.off()
I get a file that does have height and width as well as viewport.
e.g.,
<?xml version='1.0' encoding='UTF-8' ?>
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' class='svglite' width='720.00pt' height='576.00pt' viewBox='0 0 720.00 576.00'>
I get similar results with ggplot, which is what I really want to use. I have also tried using ggsave (which is the top hit on stack overflow for saving ggplot to SVG) but I still get the height and width.
any help appreciated. Thanks!