if (FALSE) {
## Set dpi to 200
op = showtext_opts(dpi = 200)
png("dpi_200.png", 800, 800, res = 200)
par(family = "sans")
showtext_begin()
set.seed(123)
plot(density(rnorm(100)))
showtext_end()
dev.off()
## Restore old options
showtext_opts(op)
png("dpi_96.png", 800, 800, res = 96)
par(family = "sans")
showtext_begin()
set.seed(123)
plot(density(rnorm(100)))
showtext_end()
dev.off()
}
Run the code above in your browser using DataLab