@@ -22,17 +22,17 @@ update_labels <- function(p, labels) {
22
22
# ' audience. Ensure the axis and legend labels display the full variable name.
23
23
# ' Use the plot `title` and `subtitle` to explain the main findings.
24
24
# ' It's common to use the `caption` to provide information about the
25
- # ' data source.
25
+ # ' data source. `tag` can be used for adding identification tags.
26
26
# '
27
27
# ' You can also set axis and legend labels in the individual scales (using
28
- # ' the first argument, the `name`. I recommend doing that if you're
28
+ # ' the first argument, the `name`) . I recommend doing that if you're
29
29
# ' changing other scale options.
30
30
# '
31
31
# ' @param label The text for the axis, plot title or caption below the plot.
32
32
# ' @param subtitle the text for the subtitle for the plot which will be
33
33
# ' displayed below the title. Leave `NULL` for no subtitle.
34
34
# ' @param ... A list of new name-value pairs. The name should either be
35
- # ' an aesthetic, or one of "title", "subtitle", or "caption ".
35
+ # ' an aesthetic, or one of "title", "subtitle", "caption", or "tag ".
36
36
# ' @export
37
37
# ' @examples
38
38
# ' p <- ggplot(mtcars, aes(mpg, wt, colour = cyl)) + geom_point()
@@ -47,6 +47,10 @@ update_labels <- function(p, labels) {
47
47
# ' # The caption appears in the bottom-right, and is often used for
48
48
# ' # sources, notes or copyright
49
49
# ' p + labs(caption = "(based on data from ...)")
50
+ # '
51
+ # ' # The plot tag appears at the top-left, and is typically used
52
+ # ' # for labelling a subplot with a letter.
53
+ # ' p + labs(title = "title", tag = "A")
50
54
labs <- function (... ) {
51
55
args <- list (... )
52
56
if (is.list(args [[1 ]])) args <- args [[1 ]]
0 commit comments