Saves plot to a PNG file in path_fig whose name is
filename followed by the current Unix timestamp, ensuring unique
file names across repeated calls.
Value
The path of the saved file, invisibly (the value of
ggplot2::ggsave()). Called for its side effect.
Examples
if (requireNamespace("ggplot2", quietly = TRUE) &&
requireNamespace("ggpubr", quietly = TRUE) &&
requireNamespace("scales", quietly = TRUE)) {
data("dt_calibration")
d <- dt_calibration
dt <- data.frame(x = d$grid$col, y = d$grid$row, fill = d$field$z[10, ])
p <- quick_heat(dt, max_y = max(d$field$z))
path_fig <- tempfile("spdbl_fig_")
dir.create(path_fig)
quick_save("heat", path_fig, p)
list.files(path_fig)
unlink(path_fig, recursive = TRUE)
}
