ggfootnote: Add footnotes to a ggplot figure

Description Usage Arguments Details Value Author(s) Examples

View source: R/ggfootnote.R

Description

This function adds a series of strings as separate lines in the footer of a ggplot figure.

Usage

1
ggfootnote(plot, ..., use_small_text = TRUE)

Arguments

plot

A ggplot figure

...

A series of strings to appear as separate lines in the footer of the figure

use_small_text

Logical; should the footnote be set in a smaller font size than the rest of the plot?

Details

This function does not work with the '+' notation used in ggplot. It should be called after the figure is otherwise complete, as the object returned is no longer a ggplot object and is not directly editable. Nonetheless, it works with ggsave as any ggplot figure.

Value

A figure with footnotes

Author(s)

Charlie Gibbons

Examples

1
2
3
p <- qplot(carat, price, data = diamonds, color = cut)
ggfootnote(p, "Source: diamonds data distributed with the ggplot package",
              "Thanks Hadley!")

Brattle/BrattleExtras documentation built on May 6, 2019, 8:47 a.m.