Skip to content
Closed
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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ggplot2 (development version)

* `continuous_scale()` passes sorted limits to scale (@teunbrand, #5918)
* The `arrow.fill` parameter is now applied to more line-based functions:
`geom_path()`, `geom_line()`, `geom_step()` `geom_function()`, line
geometries in `geom_sf()` and `element_line()`.
Expand Down
13 changes: 8 additions & 5 deletions R/scale-.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ continuous_scale <- function(aesthetics, scale_name = deprecated(), palette, nam
guide <- "none"
}

transform <- as.transform(transform)
if (!is.null(limits) && !is.function(limits)) {
limits <- transform$transform(limits)
}

# Convert formula to function if appropriate
limits <- allow_lambda(limits)
breaks <- allow_lambda(breaks)
Expand All @@ -140,6 +135,14 @@ continuous_scale <- function(aesthetics, scale_name = deprecated(), palette, nam
oob <- allow_lambda(oob)
minor_breaks <- allow_lambda(minor_breaks)

transform <- as.transform(transform)
if (!is.null(limits) && !is.function(limits)) {
limits <- transform$transform(limits)
if (!anyNA(limits)) {
limits <- sort(limits)
}
}

ggproto(NULL, super,
call = call,

Expand Down
2 changes: 1 addition & 1 deletion R/scale-view.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ view_scale_primary <- function(scale, limits = scale$get_limits(),
name = scale$name,
scale_is_discrete = scale$is_discrete(),
limits = limits,
continuous_range = continuous_range,
continuous_range = continuous_scale_sorted,
breaks = breaks,
minor_breaks = minor_breaks
)
Expand Down