r-lib / svglite

A lightweight svg graphics device for R
https://svglite.r-lib.org
180 stars 39 forks source link

Axis formating #49

Closed PMassicotte closed 8 years ago

PMassicotte commented 8 years ago

I'm having some difference using svg vs svglite device when producing the following html file. On the second plot (using svglite) the lables are too close of the tick and we are missing the bottom line of the graphic box.

https://gist.github.com/PMassicotte/4eb1e09255ef2bdb39af

hadley commented 8 years ago

Can you please provide a minimal reproducible example inline, including the images?

hadley commented 8 years ago

Can you please make it inline, with proper markdown formatting?

PMassicotte commented 8 years ago
library(ggplot2)
theme_set(theme_bw())

x <- seq(0, 5, length.out = 100)
y <- df(x, 3, 230)

svg("plot_svg.svg", width = 5, height = 4)
qplot(x, y, geom = "line", xlab = "F value", ylab = "f(x)")
dev.off()

png::writePNG(rsvg::rsvg("plot_svg.svg"), "plot_svg.png")

svglite::svglite("plot_svglite.svg", width = 5, height = 4)
qplot(x, y, geom = "line", xlab = "F value", ylab = "f(x)")
dev.off()

png::writePNG(rsvg::rsvg("plot_svglite.svg"), "plot_svglite.png"))

plot_svg

plot_svglite

hadley commented 8 years ago

Duplicate of #47

hadley commented 8 years ago

And #48