R: RColorBrewerをためす [統計]
compBiomeBlog: R: Using RColorBrewer to colour your figures in R
ということで、RColorBrewerをためしてみた。
ということで、RColorBrewerをためしてみた。
library(RColorBrewer) n <- 8 ## sequential palettes p1 <- c("Blues", "BuGn", "BuPu", "GnBu", "Greens", "Greys", "Oranges", "OrRd", "PuBu", "PuBuGn", "PuRd", "Purples", "RdPu", "Reds", "YlGn", "YlGnBu", "YlOrBr", "YlOrRd") png("Palette.seq.png", width = 520, height = 720) par(mfrow = c(6, 3)) sapply(p1, function(p) display.brewer.pal(n, p)) dev.off() ## diverging palettes p2 <- c("BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu", "RdYlGn", "Spectral") png("Palette.div.png", width = 520, height = 360) par(mfrow = c(3, 3)) sapply(p2, function(p) display.brewer.pal(n, p)) dev.off() ## all png("Palette.all.png", width = 520, height = 520) display.brewer.all() dev.off()
タグ:R
コメント 0