Skip to content

Commit 78be71d

Browse files
committed
labels derived from NULL aesthetics serve only as fallback labels
1 parent af6f4e8 commit 78be71d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/aes-evaluation.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,10 @@ strip_stage <- function(expr) {
350350
make_labels <- function(mapping) {
351351
default_label <- function(aesthetic, mapping) {
352352
# e.g., geom_smooth(aes(colour = "loess")) or aes(y = NULL)
353-
if (is.null(mapping) || is.atomic(mapping)) {
353+
if (is.null(mapping)) {
354+
return(structure(aesthetic, fallback = TRUE))
355+
}
356+
if (is.atomic(mapping)) {
354357
return(aesthetic)
355358
}
356359
mapping <- strip_stage(mapping)

0 commit comments

Comments
 (0)