borders

0th

Percentile

Create a layer of map borders.

Create a layer of map borders.

Usage
borders(database = "world", regions = ".", fill = NA, colour = "grey50",
  ...)
Arguments
database
map data, see map for details
regions
map region
fill
fill colour
colour
border colour
...
other arguments passed onto geom_polygon
Aliases
  • borders
Examples
if (require("maps")) {

ia <- map_data("county", "iowa")
mid_range <- function(x) mean(range(x))
library(plyr)
seats <- ddply(ia, .(subregion), colwise(mid_range, .(lat, long)))
ggplot(ia, aes(long, lat)) +
  geom_polygon(aes(group = group), fill = NA, colour = "grey60") +
  geom_text(aes(label = subregion), data = seats, size = 2, angle = 45)

data(us.cities)
capitals <- subset(us.cities, capital == 2)
ggplot(capitals, aes(long, lat)) +
  borders("state") +
  geom_point(aes(size = pop)) +
  scale_size_area()

}
Documentation reproduced from package ggplot2, version 1.0.1, License: GPL-2

Community examples

Looks like there are no examples yet.