Skip to content

Commit

Permalink
minor updates, ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Oct 10, 2023
1 parent dec8d98 commit c189003
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/plotSPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ plotSPC <- function(
col.label = color,
col.palette = c("#5E4FA2", "#3288BD", "#66C2A5","#ABDDA4", "#E6F598",
"#FEE08B","#FDAE61", "#F46D43", "#D53E4F","#9E0142"),
col.palette.bias = 1,
col.palette.bias = 1,
col.legend.cex = 1,
n.legend = 8,
lwd = 1,
Expand Down
4 changes: 2 additions & 2 deletions R/sketch-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
if(is.numeric(h[[color]])) {

# generate color ramp function
cr <- grDevices::colorRamp(col.palette, bias = col.palette.bias)
cr <- grDevices::colorRamp(col.palette, bias = col.palette.bias, space = 'Lab', interpolate = 'spline')

# re-scale to [0,1]
# may contain NAs
Expand Down Expand Up @@ -264,7 +264,7 @@
h[[color]] <- droplevels(h[[color]])
color.levels <- levels(h[[color]])

crp <- grDevices::colorRampPalette(col.palette, bias = col.palette.bias)
crp <- grDevices::colorRampPalette(col.palette, bias = col.palette.bias, space = 'Lab', interpolate = 'spline')

# make a color mapping function
if (requireNamespace("scales", quietly = TRUE)) {
Expand Down
23 changes: 23 additions & 0 deletions misc/sandbox/Flexoki-color-test.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

x <- lapply(1:40, random_profile, method = 'LPP', lpp.a=5, lpp.b=10, lpp.d=5, lpp.e=5, lpp.u=25, n_prop = 1, SPC = TRUE, HzDistinctSim = TRUE)
x <- combine(x)

x$hzd <- hzDistinctnessCodeToOffset(x$HzDistinctCode)


# https://stephango.com/flexoki
# .cols <- c('#A02F6F', '#AF3029', '#BC5215', '#AD8301', '#66800B', '#24837B', '#205EA6', '#5E409D')
.cols <- c('#CE5D97', '#D14D41', '#DA702C', '#D0A215', '#879A39', '#3AA99F', '#4385BE', '#8B7EC8')


par(mar = c(0, 0, 0, 1), bg = 'black', fg = 'white')
plotSPC(x, col.palette = .cols, color = 'p1', width = 0.4, hz.distinctness.offset = 'hzd', lwd = 0.5, print.id = FALSE, depth.axis = list(cex = 0.9, line = -3, style = 'tra'))
title('Flexoki Light', col.main = 'white', line = -2)



library(soilDB)

x <- fetchOSD(c('AVA', 'AUBURN'), extended = TRUE)

x$climate.annual

0 comments on commit c189003

Please sign in to comment.