Skip to content

Commit

Permalink
Correct aspect ratios for maps
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Dec 11, 2009
1 parent d387066 commit ee57525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Bug fixes
* coord_cartesian now correctly sets limits when one or both of the position
scales are non-linear. (fixes #17)
* coord_equal: now works with non-linear scales (fixes #13)
* coord_map now sets aspect ratio correctly (fixes #4)
* coord_trans now respects scale expand parameter (expansion occurs after
transformation) (fixes #14)
* facet_grid with scales = "free" and space = "free" now calculates space
Expand Down
4 changes: 4 additions & 0 deletions R/coord-map.r
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ CoordMap <- proto(Coord, {
out
}

compute_aspect <- function(., ranges) {
diff(ranges$y.range) / diff(ranges$x.range)
}


mproject <- function(., x, y, orientation) {
suppressWarnings(do.call("mapproject", list(
Expand Down

0 comments on commit ee57525

Please sign in to comment.