par(mfrow = c(4, 1), mar = rep(1, 4))
data("cbPalette8")
plot.new()
plot.window(xlim = c(1, 8), ylim = c(-1, 1))
text(1:8, 1, col = cbPalette8)
points(1:8, rep(0, 8), bg = cbPalette8, col = altPalette8,
pch = 22, cex = 2)
data("cbPalette12")
plot.new()
plot.window(xlim = c(1, 12), ylim = c(-1, 1))
text(1:12, 1, col = cbPalette12)
points(1:12, rep(0, 12), bg = cbPalette12, col = altPalette12,
pch = 22, cex = 2)
data("cbPalette15")
plot.new()
plot.window(xlim = c(1, 15), ylim = c(-1, 1))
text(1:15, 1, col = cbPalette15)
points(1:15, rep(0, 15), bg = cbPalette15, col = altPalette15,
pch = 22, cex = 2)
plot.new()
plot.window(xlim = c(1, 25), ylim = c(-1, 1))
text(1:24, 1, col = cbPalette24)
points(1:24, rep(0, 24), bg = cbPalette24, col = altPalette24,
pch = 22, cex = 2)
Run the code above in your browser using DataLab