Skip to content

Commit 4825054

Browse files
thomasp85hadley
authored andcommitted
Sample points uniformly from transformed space (#2095)
Fixes #1992
1 parent 2521cc2 commit 4825054

File tree

5 files changed

+220
-3
lines changed

5 files changed

+220
-3
lines changed

NEWS.md

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

3+
* Fix bug in secondary axis that would lead to incorrectly placed ticks with
4+
strong transforms (@thomasp85, #1992)
5+
36
* Fix `update_geom_defaults()` and `update_stat_defaults()` to allow American spelling of aesthetic parameters (@foo-bar-baz-qux, #2299).
47

58
* Fixed bug when setting strips to `element_blank()` (@thomasp85).

R/axis-secondary.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
114114
if (self$empty()) return()
115115

116116
# Get original range before transformation
117-
inv_range <- scale$trans$inverse(range)
117+
along_range <- seq(range[1], range[2], length.out = self$detail)
118+
old_range <- scale$trans$inverse(along_range)
118119

119120
# Create mapping between primary and secondary range
120-
old_range <- seq(inv_range[1], inv_range[2], length.out = self$detail)
121121
full_range <- self$transform_range(old_range)
122122

123123
# Test for monotonicity

tests/figs/deps.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
vdiffr: 0.1.1.9000
1+
vdiffr: 0.1.1
22
svglite: 1.2.0.9001
33
ggplot2: 2.2.1.9000

0 commit comments

Comments
 (0)