Skip to content

Commit 1712dc9

Browse files
committed
Improve style
1 parent effa636 commit 1712dc9

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

NEWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,6 @@ version of ggplot.
337337
338338
## Bug fixes and minor improvements
339339
340-
* `borders()` now accepts xlim and ylim arguments for specifying the geographical
341-
region of interest (@markpayneatwork, #1392)
342-
343340
* All partially matched arguments and `$` have been been replaced with
344341
full matches (@jimhester, #1134).
345342
@@ -354,6 +351,9 @@ version of ggplot.
354351
making it easier to plot multiple grobs with the same name (e.g. grobs of
355352
ggplot2 graphics) in the same plot (#1256).
356353

354+
* `borders()` now accepts xlim and ylim arguments for specifying the geographical
355+
region of interest (@markpayneatwork, #1392).
356+
357357
* `coord_cartesian()` applies the same expansion factor to limits as for scales.
358358
You can suppress with `expand = FALSE` (#1207).
359359

R/fortify-map.r

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ map_data <- function(map, region = ".", exact = FALSE, ...) {
7474
#' @param regions map region
7575
#' @param fill fill colour
7676
#' @param colour border colour
77-
#' @param xlim,ylim latitudinal and logitudinal range for extracting map polygons, see \code{\link[maps]{map}} for details
77+
#' @param xlim,ylim latitudinal and logitudinal range for extracting map
78+
#' polygons, see \code{\link[maps]{map}} for details.
7879
#' @param ... other arguments passed onto \code{\link{geom_polygon}}
7980
#' @export
8081
#' @examples
@@ -92,17 +93,18 @@ map_data <- function(map, region = ".", exact = FALSE, ...) {
9293
#' ggplot(capitals, aes(long, lat)) +
9394
#' borders("state") +
9495
#' geom_point(aes(size = pop)) +
95-
#' scale_size_area()
96-
#'
97-
#' #Same map, with geographical context
98-
#' data(us.cities)
99-
#' capitals <- subset(us.cities, capital == 2)
96+
#' scale_size_area() +
97+
#' coord_quickmap()
98+
#'
99+
#' # Same map, with some world context
100100
#' ggplot(capitals, aes(long, lat)) +
101101
#' borders("world", xlim = c(-130, -60), ylim = c(20, 50)) +
102102
#' geom_point(aes(size = pop)) +
103-
#' scale_size_area() + coord_quickmap(xlim = c(-130, -60), ylim = c(20, 50))
103+
#' scale_size_area() +
104+
#' coord_quickmap()
104105
#' }
105-
borders <- function(database = "world", regions = ".", fill = NA, colour = "grey50", xlim=NULL,ylim=NULL,...) {
106+
borders <- function(database = "world", regions = ".", fill = NA,
107+
colour = "grey50", xlim = NULL, ylim = NULL, ...) {
106108
df <- map_data(database, regions, xlim = xlim, ylim = ylim)
107109
geom_polygon(aes_(~long, ~lat, group = ~group), data = df,
108110
fill = fill, colour = colour, ..., inherit.aes = FALSE)

man/borders.Rd

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)