getColoursGrainType {sarp.snowprofile} | R Documentation |
Gets colours for plotting snow grain types
Description
Grain colours are defined in the grainDict
data.frame and the definitions can be changed with setColoursGrainType
Usage
getColoursGrainType(Grains, grainDict. = grainDict)
Arguments
Grains |
grain type (character or list of characters) |
grainDict. |
lookup table to use. Note, the easiest and best way to do this is via |
Value
Array with HTML colour codes
Author(s)
phaegeli, shorton, fherla
See Also
setColoursGrainType, getColoursDensity, getColoursGrainSize, getColoursHardness, getColoursLWC, getColoursSnowTemp
Examples
Grains <- c('PP', 'DF', 'RG', 'FC', 'FCxr', 'DH', 'SH', 'MF', 'MFcr', 'IF')
Colours <- getColoursGrainType(Grains)
Colours
plot(1:length(Grains), col = Colours, pch = 20, cex = 3)
text(1:length(Grains), 1:length(Grains), Grains, pos = 1)