Skip to content

Commit b8a5249

Browse files
committed
account for flipped aesthetics
1 parent cb95499 commit b8a5249

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/geom-smooth.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ GeomSmooth <- ggproto("GeomSmooth", Geom,
124124
setup_params = function(data, params) {
125125
params$flipped_aes <- has_flipped_aes(data, params, range_is_orthogonal = TRUE, ambiguous = TRUE)
126126
params$se <- params$se %||%
127-
all(c("ymin", "ymax") %in% names(data))
127+
if (params$flipped_aes) {
128+
all(c("xmin", "xmax") %in% names(data))
129+
} else {
130+
all(c("ymin", "ymax") %in% names(data))
131+
}
132+
128133
params
129134
},
130135

0 commit comments

Comments
 (0)