Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. library(marmap)
  2. library(ggplot)
  3.  
  4. greys <- c(grey(0.6), grey(0.93), grey(0.99))
  5.  
  6. # Get map data
  7. bat <- getNOAA.bathy(-68, -51, -48, -39, res = 1, keep = TRUE)
  8.  
  9. autoplot(bat, geom=c("raster", "contour"), colour="white", size=0.1) +
  10. scale_fill_gradientn(limits = c(-6600, 0), colors=c("steelblue4", "#C7E0FF")) +
  11. NULL
  12.  
  13. # I have tried setting different limits in `scale_fill_gradientn` but without much luck
  14.  
  15. # Generate map
  16. autoplot(bat, geom=c("raster", "contour"), colour="white", size=0.1) +
  17. scale_fill_gradientn(limits = c(min(bat), max(bat)), colors=c("steelblue4", "#C7E0FF", greys)) +
  18. NULL
  19.  
  20. # Baseplot
  21. plot(bat, image = TRUE, land = TRUE, lwd = 0.1, bpal = list(c(0, max(bat), greys), c(min(bat), 0, blues)))
  22. plot(bat, lwd = 0.8, deep = 0, shallow = 0, step = 0, add = TRUE) # highlight coastline
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement