View source: R/getColoursStability.R
getColoursStability | R Documentation |
Gets colours for plotting snow stability indices in snowprofiles.
getColoursStability(
Values,
StabilityIndexThreshold = 0.77,
StabilityIndexRange = c(0, 1),
invers = FALSE,
Resolution = 100
)
Values |
Stability index values |
StabilityIndexThreshold |
A scalar threshold that defines the transition from medium to poor stability. The color scheme will be adjusted so that this threshold becomes apparent from the colours. |
StabilityIndexRange |
The range the index spans, e.g. for TSA |
invers |
Indices like TSA/ RTA/ p_unstable increase the poorer layer stability gets. For indices with revers behaviour (e.g.,, critical crack length) switch this flag to |
Resolution |
Resolution of colour scale. Default is 100. |
Array with HTML colour codes
fherla
getColoursGrainSize, getColoursGrainType, getColoursHardness, getColoursLWC, getColoursSnowTemp, getColoursPercentage
p_unstable <- seq(0, 1, by=0.1)
plot(x = rep(1,length(p_unstable)), y = p_unstable,
col = getColoursStability(p_unstable), pch = 19, cex = 3)
critical_crack_length <- c(seq(0.2, 0.8, by=0.1), 1.5, 2.5)
plot(x = rep(1,length(critical_crack_length)), y = critical_crack_length, pch = 19, cex = 3,
col = getColoursStability(critical_crack_length, StabilityIndexThreshold = 0.4,
StabilityIndexRange = c(0, 3), invers = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.