View source: R/xtra_watermark.R
| add_watermark | R Documentation |
Overlays large, semi-transparent, rotated text across a ggplot or
xpose_plot object (e.g. "DRAFT", "PRELIMINARY", "CONFIDENTIAL").
Calling it directly always adds a watermark (falling back to the
built-in defaults below if nothing else is configured). It is also
applied automatically by print.xpose_plot() and
ggsave_xp() whenever a default_watermark is actually configured
(see the auto_apply entry in set_xtras_options()) – unlike this
function, that automatic trigger never invents an unconfigured
watermark on its own.
label/colour/alpha/size/angle/fontface resolve with the same
precedence as apply_default_labs(): (in increasing precedence) the
xpose.xtras.default_watermark R option, xpdb-level defaults set via
set_default_watermark() (when xpdb is supplied), then the argument
itself when explicitly passed. Built-in fallbacks ("DRAFT",
"grey50", 0.3, 24, 30, "bold") apply if a setting isn't
resolved from any of those.
add_watermark(plot, label, colour, alpha, size, angle, fontface, xpdb = NULL)
plot |
< |
label |
< |
colour |
< |
alpha |
< |
size |
< |
angle |
< |
fontface |
< |
xpdb |
< |
plot, with the watermark layer added
set_xtras_options() for the full list of xpose.xtras.*
session options, and get_xtras_option() to check which tier
(option/xpdb) is currently dominant for a given xpdb.
p <- xpose::dv_vs_ipred(xpose::xpdb_ex_pk)
add_watermark(p, label = "PRELIMINARY")
options(xpose.xtras.default_watermark = list(label = "CONFIDENTIAL", colour = "red"))
add_watermark(p)
options(xpose.xtras.default_watermark = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.