Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ggplot2 (development version)

* `ScaleContinuous$get_breaks()` now only calls `scales::zero_range()` on limits
in transformed space, rather than in data space (#5304).

* `coord_munch()` can now close polygon shapes (@teunbrand, #3271)

* You can now omit either `xend` or `yend` from `geom_segment()` as only one
Expand Down
4 changes: 3 additions & 1 deletion R/scale-.R
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,9 @@ ScaleContinuous <- ggproto("ScaleContinuous", Scale,
cli::cli_abort("Invalid {.arg breaks} specification. Use {.val NULL}, not {.val NA}")
}

if (zero_range(as.numeric(limits))) {
# Compute `zero_range()` in transformed space in case `limits` in data space
# don't support conversion to numeric (#5304)
if (zero_range(as.numeric(self$trans$transform(limits)))) {
breaks <- limits[1]
} else if (is.waive(self$breaks)) {
if (!is.null(self$n.breaks) && trans_support_nbreaks(self$trans)) {
Expand Down