Skip to content

Commit 7cf6e07

Browse files
authored
Use minor breaks that are part of the transformation (#2192)
Fixes #2081
1 parent 9c7dcde commit 7cf6e07

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Imports:
1919
MASS,
2020
plyr (>= 1.7.1),
2121
reshape2,
22-
scales (>= 0.4.1),
22+
scales (>= 0.4.1.9002),
2323
stats,
2424
tibble,
2525
lazyeval
@@ -45,6 +45,7 @@ Suggests:
4545
sf (>= 0.3-4),
4646
svglite (>= 1.2.0.9001)
4747
Remotes:
48+
hadley/scales,
4849
hadley/svglite
4950
Enhances: sp
5051
License: GPL-2 | file LICENSE

R/scale-.r

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,7 @@ ScaleContinuous <- ggproto("ScaleContinuous", Scale,
272272
if (is.null(b)) {
273273
breaks <- NULL
274274
} else {
275-
b <- b[!is.na(b)]
276-
if (length(b) < 2) return()
277-
278-
bd <- diff(b)[1]
279-
if (min(limits) < min(b)) b <- c(b[1] - bd, b)
280-
if (max(limits) > max(b)) b <- c(b, b[length(b)] + bd)
281-
breaks <- unique(unlist(mapply(seq, b[-length(b)], b[-1], length.out = n + 1,
282-
SIMPLIFY = FALSE)))
275+
breaks <- self$trans$minor_breaks(b, limits, n)
283276
}
284277
} else if (is.function(self$minor_breaks)) {
285278
# Find breaks in data space, and convert to numeric

0 commit comments

Comments
 (0)