Skip to content

Commit c84a16a

Browse files
committed
return plot as-is when default coords are added to user coords
1 parent bed8e32 commit c84a16a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/plot-construction.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ S7::method(update_ggplot, list(class_theme, class_ggplot)) <-
200200
S7::method(update_ggplot, list(class_coord, class_ggplot)) <-
201201
function(object, plot, ...) {
202202
if (!isTRUE(plot@coordinates$default)) {
203+
204+
if (isTRUE(object$default)) {
205+
# We don't let default coords override non-default coords (#6572)
206+
return(plot)
207+
}
208+
203209
cli::cli_inform(c(
204210
"Coordinate system already present.",
205211
i = "Adding new coordinate system, which will replace the existing one."

0 commit comments

Comments
 (0)