View source: R/theme_grainscape.R
| theme_grainscape | R Documentation | 
ggplot2 theme for grainscapeA ggplot2 theme designed for grainscape based on the
ggthemes::theme_map() theme, with several modifications.
theme_grainscape(base_size = 9, base_family = "")
| base_size | Base font size | 
| base_family | Base font family | 
A theme suitable for use with ggplot2::ggplot()
Paul Galpern and Alex Chubaty
ggGS(), plot(), ggthemes::theme_map()
## Load raster landscape
tiny <- raster::raster(system.file("extdata/tiny.asc", package = "grainscape"))
## Create a resistance surface from a raster using an is-becomes reclassification
tinyCost <- raster::reclassify(tiny, rcl = cbind(c(1, 2, 3, 4), c(1, 5, 10, 12)))
## Produce a patch-based MPG where patches are resistance features=1
tinyPatchMPG <- MPG(cost = tinyCost, patch = tinyCost == 1)
if (interactive()) {
  library(ggplot2)
  ## Plot the patches in a minimum planar graph
  theme_set(theme_grainscape())
  plot(tinyPatchMPG, quick = "mpgPlot")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.