From b8a5249634a8b9f680f297969a037f03d3664ca7 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 22 Feb 2024 14:57:32 +0100 Subject: [PATCH] account for flipped aesthetics --- R/geom-smooth.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/geom-smooth.R b/R/geom-smooth.R index 45ac8c4972..90137fddd0 100644 --- a/R/geom-smooth.R +++ b/R/geom-smooth.R @@ -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 },