legend.whitening: Whitening legend (PNG)

kml_legend.whiteningR Documentation

Whitening legend (PNG)

Description

Produces a PNG file that can be used in KML plots (visualization of uncertainty).

Usage

kml_legend.whitening(legend.res = 0.01, width = 120, height = 300, pointsize = 14, 
                 x.lim, e.lim, leg.asp = 0.3 *  width/height, 
                 legend.file = "whitening_legend.png",
                 matte = FALSE, png.type)

Arguments

legend.res

numeric; resolution on a 0-1 scale

width

integer; image width

height

integer; image height

pointsize

integer; point size in units for text

x.lim

numeric; upper and lower limits for target variable

e.lim

numeric; upper and lower limits for the normalized error

leg.asp

numeric; legend aspect

legend.file

character; output PNG file name

matte

logical; specify whether to fix transparency using ImageMagick

png.type

character; PNG type

Details

The output PNG file shows a 2D legend with values on the vertical axis and uncertainty on the horizontal axis. Whitening is only valid with Hue-Saturation-Intensity system where Hue's are used to represent values of the target variable, so that the amount of white color can be linearly used to represent uncertainty (i.e. whitening can not be used with different color palettes; or at least we do not recommend this).

Note

Google Earth does not properly handle a 24-bit PNG file which has a single transparent color. In order to force transparency in the output PNG, the function with try using ImageMagick convert function. ImageMagick needs to be installed separately and located using plotKML.env().

Author(s)

Tomislav Hengl

References

See Also

whitening

Examples

## Not run: # create the 2D legend for whitening (PNG file):
kml_legend.whitening(x.lim=c(5,20), e.lim=c(.6,1))

## End(Not run)

plotKML documentation built on June 7, 2022, 5:07 p.m.