Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ggplot2 (development version)

* The default `se` parameter in layers with `geom = "smooth"` will be `TRUE`
when the data has `ymin` and `ymax` parameters and `FALSE` if these are
absent. Note that this does not affect the default of `geom_smooth()` or
`stat_smooth()` (@teunbrand, #5572).
* The bounded density option in `stat_density()` uses a wider range to
prevent discontinuities (#5641).
* `geom_raster()` now falls back to rendering as `geom_rect()` when coordinates
Expand Down
7 changes: 7 additions & 0 deletions R/geom-smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ geom_smooth <- function(mapping = NULL, data = NULL,
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 %||%
if (params$flipped_aes) {
all(c("xmin", "xmax") %in% names(data))
} else {
all(c("ymin", "ymax") %in% names(data))
}

params
},

Expand Down