| plot.speciesRaster | R Documentation |
Plot a speciesRaster object.
## S3 method for class 'speciesRaster'
plot(
x,
log = FALSE,
colorRampRange = NULL,
legend = TRUE,
col = c("blue", "yellow", "red"),
basemap = "worldmap",
box = TRUE,
axes = TRUE,
location = "right",
add = FALSE,
singleSpCol = gray(0.9),
...
)
x |
object of class |
log |
boolean; should the cell values be logged? |
colorRampRange |
numeric vector of min and max value for scaling the color
ramp. Automatically inferred if set to |
legend |
boolean; should legend be included? |
col |
either a vector of color names that will be interpolated, or a color ramp
function that takes an integer (see for example |
basemap |
if |
box |
boolean; should box be drawn around plot? |
axes |
boolean; should axes be included? |
location |
location of legend, if included. See |
add |
Logical. Wether to add to current plot |
singleSpCol |
color for single-species cells. See details. |
... |
additional parameters will be passed to the |
If x is a metric as generated with cellMetrics_speciesRaster that returns 0
for single-species cells, then those cells (that have a value of 0) will be plotted in gray (or any color
as specified with singleSpCol).
Nothing is returned.
Pascal Title
plot(tamiasSpRas)
plot(tamiasSpRas, legend=FALSE, axes=FALSE, box=FALSE)
addRasterLegend(tamiasSpRas, location = 'top', ramp=c('blue','yellow','red'))
# Example for how to plot multiple speciesRasters on the same color scale
# for illustration purposes, we will compare weighted endemism to
# phylogenetic weighted endemism
tamiasSpRas <- addPhylo_speciesRaster(tamiasSpRas, tamiasTree)
spRas1 <- cellMetrics_speciesRaster(tamiasSpRas, metric='weightedEndemism')
spRas2 <- cellMetrics_speciesRaster(tamiasSpRas, metric='phyloWeightedEndemism')
# get global min and max values
minmax <- getMultiMapRamp(list(spRas1, spRas2))
par(mfrow = c(1,2))
plot(spRas1, colorRampRange = log(minmax), log = TRUE, location='right')
plot(spRas2, colorRampRange = log(minmax), log = TRUE, location='left')
# use leaflet for plotting
plot(tamiasSpRas, basemap = 'leaflet')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.