Learn R Programming

SciencesPo (version 0.11.21)

add.footnote: Footnote to ggplot object

Description

Adds a footnote to ggplot object

Usage

add.footnote(text, size = 0.7, color = grey(0.75))

Arguments

text
Any text or empty to use default.
size
The size for text.
color
Color for text.

encoding

UTF-8

Details

Only works with a ggplot object.

Examples

Run this code
# setup data
x <- seq(0, 50, 1)
supply <- x * -2 + 100
demand <- x * 2
df <- data.frame( x = x, supply=supply, demand=demand)

library(ggplot2)
ggplot(df, aes(x)) + 
geom_line(aes(y = supply, colour = supply))+ 
geom_line(aes(y = demand, colour = demand))
add.footnote()

Run the code above in your browser using DataLab