How to add a footnote to ggplot2 plots?

To add a footnote to a ggplot2 plot, you can use the annotate() function. This function allows you to add text or graphical elements to your plot, such as a footnote. You can use the annotate() function to add a footnote at the bottom of your plot that contains extra information that you may want to convey to your viewers. You can also use this function to add graphical elements such as arrows, lines, or shapes to your plot.


You can use the caption argument within the labs() function to add a footnote to a plot in ggplot2.

There are two common ways to use this argument in practice:

Method 1: Add Footnote in Bottom Right Corner

p +
  labs(caption = "Here is a footnote")

Method 2: Add Footnote in Bottom Left Corner

p +
  labs(caption = "Here is a footnote") +
  theme(plot.caption = element_text(hjust=0))

The following examples show how to use each method in practice with the following data frame in R:

#create data frame
df <- data.frame(assists=c(1, 2, 2, 3, 5, 6, 7, 8, 8),
                 points=c(3, 6, 9, 14, 20, 23, 16, 19, 26))

#view data frame
df

  assists points
1       1      3
2       2      6
3       2      9
4       3     14
5       5     20
6       6     23
7       7     16
8       8     19
9       8     26

Example 1: Add Footnote in Bottom Right Corner

The following code shows how to create a scatter plot in gglot2 and add a footnote in the bottom right corner below the plot:

library(ggplot2)

#create scatter plot with footnote in bottom right corner
ggplot(df, aes(x=assists, y=points)) +
  geom_point(size=3) +
  labs(caption = "Here is a footnote")

ggplot2 add footnote

Notice that a footnote has been added to the bottom right corner below the plot.

Example 2: Add Footnote in Bottom Left Corner

The following code shows how to create a scatter plot in gglot2 and add a footnote in the bottom left corner below the plot:

library(ggplot2)

#create scatter plot with footnote in bottom left corner
ggplot(df, aes(x=assists, y=points)) +
  geom_point(size=3) +
  labs(caption = "Here is a footnote") +
  theme(plot.caption = element_text(hjust=0))

ggplot2 add footnote in bottom left corner

Note that the argument hjust=0 specifies that the footnote should be left-aligned.

You can also specify hjust=0.5 to place the footnote in the bottom center outside the plot.

Related:

The following tutorials explain how to perform other common tasks in ggplot2:

x