2.4.4. Színek választása a dichromat csomag segítségével

A dichromat csomag színsémai küzöl is választhatunk. A színsémákat a colorschemes lista tartalmazza. A lisatelemek neve:

library(dichromat)
names(colorschemes)
 [1] "BrowntoBlue.10"         "BrowntoBlue.12"        
 [3] "BluetoDarkOrange.12"    "BluetoDarkOrange.18"   
 [5] "DarkRedtoBlue.12"       "DarkRedtoBlue.18"      
 [7] "BluetoGreen.14"         "BluetoGray.8"          
 [9] "BluetoOrangeRed.14"     "BluetoOrange.10"       
[11] "BluetoOrange.12"        "BluetoOrange.8"        
[13] "LightBluetoDarkBlue.10" "LightBluetoDarkBlue.7" 
[15] "Categorical.12"         "GreentoMagenta.16"     
[17] "SteppedSequential.5"   

Példák színek választására:

# az x adatvektor beállítása
set.seed(0)
x <- rpois(n = 50, lambda = 100)
# grafikus paraméterek beállítása
par(las = 1, mgp = c(0, 0.2, 0), tcl = -0.2, mar = c(3, 2, 1, 1))
library(dichromat)
barplot(x[1:10], col = colorschemes$BrowntoBlue.10, names.arg = 1:10, main = "BrowntoBlue.10")

plot of chunk unnamed-chunk-4

barplot(x[1:12], col = colorschemes$BrowntoBlue.12, names.arg = 1:12, main = "BrowntoBlue.12")

plot of chunk unnamed-chunk-4

barplot(x[1:12], col = colorschemes$BluetoDarkOrange.12, names.arg = 1:12, main = "BluetoDarkOrange.12")

plot of chunk unnamed-chunk-4

barplot(x[1:18], col = colorschemes$BluetoDarkOrange.18, names.arg = 1:18, main = "BluetoDarkOrange.18")

plot of chunk unnamed-chunk-4

barplot(x[1:12], col = colorschemes$DarkRedtoBlue.12, names.arg = 1:12, main = "DarkRedtoBlue.12")

plot of chunk unnamed-chunk-4

barplot(x[1:18], col = colorschemes$DarkRedtoBlue.18, names.arg = 1:18, main = "DarkRedtoBlue.18")

plot of chunk unnamed-chunk-4

barplot(x[1:14], col = colorschemes$BluetoGreen.14, names.arg = 1:14, main = "BluetoGreen.14")

plot of chunk unnamed-chunk-4

barplot(x[1:8], col = colorschemes$BluetoGray.8, names.arg = 1:8, main = "BluetoGray.8")

plot of chunk unnamed-chunk-4

barplot(x[1:14], col = colorschemes$BluetoOrangeRed.14, names.arg = 1:14, main = "BluetoOrangeRed.14")

plot of chunk unnamed-chunk-4

barplot(x[1:10], col = colorschemes$BluetoOrange.10, names.arg = 1:10, main = "BluetoOrange.10")

plot of chunk unnamed-chunk-4

barplot(x[1:12], col = colorschemes$BluetoOrange.12, names.arg = 1:12, main = "BluetoOrange.12")

plot of chunk unnamed-chunk-4

barplot(x[1:8], col = colorschemes$BluetoOrange.8, names.arg = 1:8, main = "BluetoOrange.8")

plot of chunk unnamed-chunk-4

barplot(x[1:10], col = colorschemes$LightBluetoDarkBlue.10, names.arg = 1:10, 
    main = "LightBluetoDarkBlue.10")

plot of chunk unnamed-chunk-4

barplot(x[1:7], col = colorschemes$LightBluetoDarkBlue.7, names.arg = 1:7, main = "LightBluetoDarkBlue.7")

plot of chunk unnamed-chunk-4

barplot(x[1:12], col = colorschemes$Categorical.12, names.arg = 1:12, main = "Categorical.12")

plot of chunk unnamed-chunk-4

barplot(x[1:16], col = colorschemes$GreentoMagenta.16, names.arg = 1:16, main = "GreentoMagenta.16")

plot of chunk unnamed-chunk-4

barplot(x[1:25], col = colorschemes$SteppedSequential.5, names.arg = 1:25, main = "SteppedSequential.5")

plot of chunk unnamed-chunk-4