Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

color.bar.raster

Graphic Representation of a Color legend of a Raster or GeotopbrickRaster object as a Color bar, inspired by the function written by John Colby


Description

Graphic Representation of a Color legend of a Raster or GeotopbrickRaster object as a Color bar, inspired by the function written by John Colby

Usage

color.bar.raster(x, col, min = NA, max = NA, ...)

Arguments

x

a Raster or GeotopRasterBrick object

col

the color palette used

max, min

maximum and minimum value (used if you need to crop the scale legend within a cartein interval)

...

arguments to be passed to color.bar

See Also

Examples

library(geotopbricks)

## Simulation working path

file <- system.file("rendena100/SnowDepthMapFile-2014-MA-mean-winter-2013-2014.asc",
package="geotopbricks")
snow <- raster(file)

min <- 0 # snow depth expressed in millimeters
max <- 2500 # snow depth expressed in millimeters

colors <- terrain.colors(1000)

color.bar.raster(x=snow,col=colors,digits=2)
color.bar.raster(x=snow,col=colors,min=min,max=max,digits=2)

geotopbricks

An R Plug-in for the Distributed Hydrological Model GEOtop

v1.5.4
GPL (>= 2)
Authors
Emanuele Cordano, Daniele Andreis, Fabio Zottele
Initial release
2020-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.