Watermark ggplot with "DRAFT" or other text.

watermark(
  plot,
  label = "DRAFT",
  size = 108,
  color = "black",
  alpha = 0.1,
  angle = 45,
  x = 0.5,
  y = 0.5,
  do = TRUE,
  ...
)

Arguments

plot

A ggplot object to be watermarked.

label

Text to use as watermark. Defaults to "DRAFT".

size

Text size in points. Defaults to 108.

color

Watermark color. Defaults to "black".

alpha

Watermark transparency. Defaults to 0.1.

angle

Watermark angle. Defaults to 45°.

x

x position of label. Defaults to 0.5.

y

y position of label. Defaults to 0.5.

do

logical specifying whether to apply the watermark. Defaults to TRUE.

...

Arguments passed to cowplot::draw_label()

Value

A ggplot2 object.

Details

Watermark ggplot with "DRAFT" or other text.

See also

Author

Dave Braze davebraze@gmail.com

Examples

library(ggplot2)
data(iris)
tmp <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
  geom_point()
  watermark(tmp)


## alternately, in an rmarkdown file maybe do

watermark(tmp, do=is_draft())