Skip to content

Commit

Permalink
updated figures
Browse files Browse the repository at this point in the history
Former-commit-id: d954408
  • Loading branch information
Robinlovelace committed Jun 22, 2014
1 parent 2151dde commit 4c73b24
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions vignettes/world-great-circles.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ plot(s)
points(p, col = "red")
```

![plot of chunk Plotting points](figure/Plotting points.png)
![plot of chunk Plotting points](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/Plotting points.png)

## Joining the dots

Expand All @@ -122,7 +122,7 @@ segments(x0 = rep(coordinates(p[1,])[1], n), y0 = rep(coordinates(p[1,])[2], n),
x1 = coordinates(p)[,1], y1 = coordinates(p)[,2])
```

![plot of chunk Plotting segments](figure/Plotting segments.png)
![plot of chunk Plotting segments](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/Plotting segments.png)

(Incidentally, isn't the use of `segments` here rather clunky - any suggestions
of a more elegant way to do this welcome.)
Expand Down Expand Up @@ -153,7 +153,7 @@ for(i in 1:length(p)){
}
```

![plot of chunk Plotting great circles 1](figure/Plotting great circles 1.png)
![plot of chunk Plotting great circles 1](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/Plotting great circles 1.png)

Fantastic. Now we have great circle lines represented on a
map with a [geographic coordinate system (CRS)](http://en.wikipedia.org/wiki/Geographic_coordinate_system)
Expand Down Expand Up @@ -199,7 +199,7 @@ for(i in 1:length(p)){
}
```

![plot of chunk Beautifying](figure/Beautifying.png)
![plot of chunk Beautifying](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/Beautifying.png)

```r
par(bg = 'white')
Expand All @@ -219,7 +219,7 @@ m <- ggplot(s, aes(x=long, y=lat, group=group)) +
m
```

![plot of chunk ggplot world 1](figure/ggplot world 1.png)
![plot of chunk ggplot world 1](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/ggplot world 1.png)

When we add the lines in projected maps (i.e. with a Euclidean coordinate system)
based solely on origins and destinations, this works fine, but
Expand All @@ -245,7 +245,7 @@ ggplot() + geom_polygon(data = s,aes(x=long, y=lat, group=group),
geom_segment(aes(x = p1[,1], y = p1[,2], xend = p2[,1], yend = p2[,2]))
```

![plot of chunk Adding world lines ggplot2 style](figure/Adding world lines ggplot2 style.png)
![plot of chunk Adding world lines ggplot2 style](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/Adding world lines ggplot2 style.png)

## Adding great circle lines to ggplot2 maps

Expand Down Expand Up @@ -289,7 +289,7 @@ ggplot() + geom_polygon(data = s, aes(x=long, y=lat, group=group),
theme(panel.background = element_rect(fill = 'lightblue'))
```

![plot of chunk polygon paths ggplo2](figure/polygon paths ggplo2.png)
![plot of chunk polygon paths ggplo2](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/polygon paths ggplo2.png)

## Changing projection in ggplot

Expand All @@ -308,7 +308,7 @@ m <- last_plot()
m + coord_map()
```

![plot of chunk ggplot2 projections](figure/ggplot2 projections1.png)
![plot of chunk ggplot2 projections](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/ggplot2 projections1.png)

```r
# remove fill as this clearly causes problems:
Expand All @@ -319,7 +319,7 @@ m <- ggplot() + geom_path(data = s, aes(x=long, y=lat, group=group), colour="bla
m + coord_map("ortho", orientation=c(41, -74, 0)) # for ortho maps
```

![plot of chunk ggplot2 projections](figure/ggplot2 projections2.png)
![plot of chunk ggplot2 projections](https://raw.githubusercontent.com/Robinlovelace/Creating-maps-in-R/master/figure/ggplot2 projections2.png)

## Conclusion

Expand Down

0 comments on commit 4c73b24

Please sign in to comment.