Convert Raster to color matrix useable by raster function for plotting

Share:

Description

Internal function.

Usage

1
2
3
4
5
6
7
.makeColorMatrix(grobToPlot, zoomExtent, maxpixels, legendRange, cols = NULL,
  na.color = "#FFFFFF00", zero.color = NULL, skipSample = TRUE)

## S4 method for signature 'Raster,Extent,numeric'
.makeColorMatrix(grobToPlot, zoomExtent,
  maxpixels, legendRange, cols = NULL, na.color = "#FFFFFF00",
  zero.color = NULL, skipSample = TRUE)

Arguments

grobToPlot

A SpatialObject.

zoomExtent

An Extent object for zooming to. Defaults to whole extent of grobToPlot.

maxpixels

Numeric. Number of cells to subsample the complete grobToPlot.

legendRange

Numeric vector giving values that, representing the lower and upper bounds of a legend (i.e., 1:10 or c(1,10) will give same result) that will override the data bounds contained within the grobToPlot.

cols

Colours specified in a way that can be understood directly or by colorRampPalette.

na.color

Character string indicating the color for NA values. Default transparent.

zero.color

Character string indicating the color for zero values, when zero is the minimum value. Otherwise, it is treated as any other color. Default transparent. Use NULL if zero should be the value given to it by the colortable associated with the Raster.

skipSample

Logical. If no downsampling is necessary, skip. Default TRUE.

Author(s)

Eliot McIntire

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.