Skip to content

Commit

Permalink
account for flipped aesthetics
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Feb 22, 2024
1 parent cb95499 commit b8a5249
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/geom-smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ GeomSmooth <- ggproto("GeomSmooth", Geom,
setup_params = function(data, params) {
params$flipped_aes <- has_flipped_aes(data, params, range_is_orthogonal = TRUE, ambiguous = TRUE)
params$se <- params$se %||%
all(c("ymin", "ymax") %in% names(data))
if (params$flipped_aes) {
all(c("xmin", "xmax") %in% names(data))
} else {
all(c("ymin", "ymax") %in% names(data))
}

params
},

Expand Down

0 comments on commit b8a5249

Please sign in to comment.