############################################################### ### Figure 12.9: Diverging color palettes for HSV and HCL space ############################################################### library(vcd) par(mfrow = c(1,1), mar = c(1,1,1,1), oma = c(0,0,0,0)) plot.new() rect(0:4/5, 0.2, 1:5/5, 0.5, border = 0, col = diverge_hcl(5, c = 100, l = c(50, 90))) rect(0, 0.2, 1, 0.5, border = 1, col = NULL) rect(0:4/5, 0.55, 1:5/5, 0.85, border = 0, col = diverge_hsv(5)) rect(0, 0.55, 1, 0.85, border = 1, col = NULL) text(c(1:5/5 - 0.1), 0.11, c("(260, 100, 50)", "(260, 50, 70)", "(H, 0, 90)", "(0, 50, 70)", "(0, 100, 50)")) text(c(1:5/5 - 0.1), 0.91, c("(240, 100, 100)", "(240, 50, 100)", "(H, 0, 100)", "(0, 50, 100)","(0, 100, 100)"))