Skip to content

Commit 0e142bb

Browse files
authored
Remove breaks that coincide with the limits of the scale (#4423)
1 parent c415307 commit 0e142bb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ggplot2 (development version)
22

3+
* Fix bug in `guide_coloursteps()` that would repeat the terminal bins if the
4+
breaks coincided with the limits of the scale (@thomasp85, #4019)
5+
36
* Extent the range of the line created by `geom_abline()` so that line ending
47
is not visible for large linewidths (@thomasp85, #4024)
58

R/guide-colorsteps.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ guide_train.colorsteps <- function(guide, scale, aesthetic = NULL) {
6464
}
6565
if (is.numeric(breaks)) {
6666
limits <- scale$get_limits()
67+
breaks <- breaks[!breaks %in% limits]
6768
all_breaks <- c(limits[1], breaks, limits[2])
6869
bin_at <- all_breaks[-1] - diff(all_breaks) / 2
6970
} else {

0 commit comments

Comments
 (0)