watermark: Watermark ggplot with "DRAFT"

View source: R/watermark.R

watermarkR Documentation

Watermark ggplot with "DRAFT"

Description

Watermark ggplot with "DRAFT" or other text.

Usage

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()

Details

Watermark ggplot with "DRAFT" or other text.

Value

A ggplot2 object.

Author(s)

Dave Braze davebraze@gmail.com

See Also

draw_label

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())


davebraze/FDBpub documentation built on April 30, 2022, 11:23 p.m.