trim_fig | R Documentation |
trim_fig()
just remove white spaces around a figure and save it into the
trim
folder (maintain the original figure untouchable)
trim_fig(figure_path, overwrite = FALSE)
figure_path |
a character vector with path of the figure |
overwrite |
logical |
trim_fig()
wraps the excellent image_trim()
of
{magick}
## Not run:
library(misc)
ipak(c("ggplot2", "dplyr"))
create_dirs()
p <- mtcars %>%
ggplot() +
aes(x = mpg, y = cyl) +
geom_point()
save_plot(p)
trim_fig("output/figures/p.png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.