Skip to content

Commit 6a261a2

Browse files
committed
Restore label overrides in qplot
Fixes #2551
1 parent 3c1649c commit 6a261a2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

R/quick-plot.r

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,16 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
8383
mapping <- rename_aes(mapping)
8484

8585

86-
xlab <- rlang::quo_name(exprs$x)
87-
# Work around quo_name() bug: https://github.com/r-lib/rlang/issues/430
88-
if (rlang::quo_is_null(exprs$y)) {
89-
ylab <- "NULL"
90-
} else {
91-
ylab <- rlang::quo_name(exprs$y)
86+
if (is.null(xlab)) {
87+
xlab <- rlang::quo_name(exprs$x)
88+
}
89+
if (is.null(ylab)) {
90+
# Work around quo_name() bug: https://github.com/r-lib/rlang/issues/430
91+
if (rlang::quo_is_null(exprs$y)) {
92+
ylab <- "NULL"
93+
} else {
94+
ylab <- rlang::quo_name(exprs$y)
95+
}
9296
}
9397

9498
if (missing(data)) {

0 commit comments

Comments
 (0)