Skip to content

Commit

Permalink
Sample points uniformly from transformed space (#2095)
Browse files Browse the repository at this point in the history
Fixes #1992
  • Loading branch information
thomasp85 authored and hadley committed Oct 30, 2017
1 parent 2521cc2 commit 4825054
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 3 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ggplot2 2.2.1.9000

* Fix bug in secondary axis that would lead to incorrectly placed ticks with
strong transforms (@thomasp85, #1992)

* Fix `update_geom_defaults()` and `update_stat_defaults()` to allow American spelling of aesthetic parameters (@foo-bar-baz-qux, #2299).

* Fixed bug when setting strips to `element_blank()` (@thomasp85).
Expand Down
4 changes: 2 additions & 2 deletions R/axis-secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
if (self$empty()) return()

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

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

# Test for monotonicity
Expand Down
2 changes: 1 addition & 1 deletion tests/figs/deps.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vdiffr: 0.1.1.9000
vdiffr: 0.1.1
svglite: 1.2.0.9001
ggplot2: 2.2.1.9000
Loading

0 comments on commit 4825054

Please sign in to comment.