Uses a device
to capture the result of an expression (expr
)
that produces a plot. If default_device()
is used, custom fonts
(specified through font_spec()
) are guaranteed to work, as long as
one of either the showtext or ragg package(s) are installed.
thematic_save_plot()
returns the filename
of the produced plot
and default_device()
returns a graphics device function.
library(thematic)
font <- font_spec("Rock Salt", scale = 1.25)
thematic_on("black", "white", font = font)
file <- thematic_save_plot(plot(1:10), res = 144)
if (interactive()) browseURL(file)