Skip to content

Instantly share code, notes, and snippets.

@dgerlanc
Last active June 28, 2018 00:02
Show Gist options
  • Select an option

  • Save dgerlanc/eec1a74d671baeb22ddb30c0f6de9e28 to your computer and use it in GitHub Desktop.

Select an option

Save dgerlanc/eec1a74d671baeb22ddb30c0f6de9e28 to your computer and use it in GitHub Desktop.

Revisions

  1. dgerlanc revised this gist Jun 28, 2018. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions use-mapdata.R
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,9 @@
    library(mapdata)
    data(us.cities)

    map("state", col="gray90", fill=TRUE, lwd=0.1, mar=c(0,0,0,0),
    xlim=c(-127,-65))
    map("worldHires", "Canada", xlim=c(-127,-110), ylim=c(48,64), col="gray95",
    fill=TRUE, add=TRUE)
    map("worldHires","Mexico", xlim=c(-127,-110), ylim=c(28,45), col="gray95",
    fill=TRUE, add=TRUE)
    map("state", col="gray90", fill=TRUE, lwd=0.1, mar=c(0,0,0,0), xlim=c(-127,-65))
    map("worldHires", "Canada", xlim=c(-127,-110), ylim=c(48,64), col="gray95", fill=TRUE, add=TRUE)
    map("worldHires","Mexico", xlim=c(-127,-110), ylim=c(28,45), col="gray95", fill=TRUE, add=TRUE)
    points(gt$long, gt$lat, cex=pt_scale, pch=19, col=MAP_BLACK)

    map.cities(us.cities, minpop=5e5, label=TRUE, pch=19, col='red')
  2. dgerlanc created this gist Jun 28, 2018.
    13 changes: 13 additions & 0 deletions use-mapdata.R
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    library(mapdata)
    data(us.cities)

    map("state", col="gray90", fill=TRUE, lwd=0.1, mar=c(0,0,0,0),
    xlim=c(-127,-65))
    map("worldHires", "Canada", xlim=c(-127,-110), ylim=c(48,64), col="gray95",
    fill=TRUE, add=TRUE)
    map("worldHires","Mexico", xlim=c(-127,-110), ylim=c(28,45), col="gray95",
    fill=TRUE, add=TRUE)
    points(gt$long, gt$lat, cex=pt_scale, pch=19, col=MAP_BLACK)

    map.cities(us.cities, minpop=5e5, label=TRUE, pch=19, col='red')
    title("Locations of Github Users", line=1)