Color ramp for bivariate colors

colorRamp2D(
  column_breaks,
  row_breaks,
  mcolor,
  na_color = "grey15",
  return_rgb = FALSE,
  transparency = 0,
  space = "sRGB",
  verbose = FALSE,
  ...
)

Examples

mcolor <- matrix(ncol=3,
   c("seashell", "salmon1", "firebrick3",
      "gray99", "lightgoldenrod1", "gold",
      "aliceblue", "skyblue", "dodgerblue3"));
row_breaks <- c(0, 0.5, 1);
column_breaks <- c(-1, 0, 1);
rownames(mcolor) <- row_breaks;
colnames(mcolor) <- column_breaks;
jamba::imageByColors(mcolor);
title(
   cex.main=1.5,
   cex.lab=1.5,
   main="Bivariate color scale",
   xlab="Directionality",
   ylab="Score");


col_fun <- colorRamp2D(column_breaks=column_breaks,
   row_breaks=row_breaks,
   mcolor=mcolor)
display_colorRamp2D(col_fun, pretty.n=c(4, 5));

display_colorRamp2D(col_fun, pretty.n=NULL);


mcolor1 <- matrix(ncol=3,
   c("white", "red",
      "white", "gold",
      "white", "blue3"));
row_breaks1 <- c(0, 1);
column_breaks1 <- c(-1, 0, 1);
rownames(mcolor1) <- row_breaks1;
colnames(mcolor1) <- column_breaks1;
jamba::imageByColors(mcolor1);


col_fun1 <- colorRamp2D(column_breaks=column_breaks1,
   row_breaks=row_breaks1,
   space="LUV",
   mcolor=mcolor1)
display_colorRamp2D(col_fun1);