View source: R/visualizations.R
plotLayers | R Documentation |
This script plots a semitransparent layer of suitable habitat for each depth layer. The redder the color, the shallower the layer, the bluer, the deeper. The more saturated the color, the more layers with suitable habitat.
plotLayers(
rast,
land = NA,
landCol = "black",
title = NULL,
graticule = TRUE,
...
)
rast |
A |
land |
An optional coastline polygon shapefile
of types |
landCol |
Color for land on map. |
title |
A title for the plot. If not title is
supplied, the title "Suitability from (MINIMUM
DEPTH) to (MAXIMUM DEPTH)" is inferred from
names of |
graticule |
Do you want a grid of lon/lat lines? |
... |
Additional optional arguments. |
A plot of class recordedplot
Only include the depth layers that you actually want to plot.
viridis
library(terra)
rast1 <- rast(ncol=10, nrow=10)
values(rast1) <- rep(0:1, 50)
rast2 <- rast(ncol=10, nrow=10)
values(rast2) <- c(rep(0, 50), rep(1,50))
rast3 <- rast(ncol=10, nrow=10)
values(rast3) <- rep(c(1,0,0,1), 25)
distBrick <- c(rast1, rast2, rast3)
plotLayers(distBrick)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.