2013-08-21 57 views

回答

3

這看起來像Matlab's Jet colours,它們被複制在?colorRampPalette

## 'jet.colors' is "as in Matlab" 
## (and hurting the eyes by over-saturation) 
jet.colors <- 
    colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", 
        "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")) 

和示例:

filled.contour(volcano, color = jet.colors, asp = 1, nlevels=100) 
+1

謝謝詹姆斯!這正是我所期待的。 – Rodrigo

3

運用gplotsrich.colors第一個環節,而且違背了你的帖子,RColorBrewer"spectral"調色板的第二個鏈接,甚至調色板,旨在模仿默認MATLAB的調色板,這是從colorRampsblue2green2red

require(gplots) 
barplot(rep(1,100), width = rep(2,100) , col=rich.colors(100), space = 0 , border=0, axes=FALSE) 

require(RColorBrewer) 
display.brewer.pal(11 , "Spectral") 

require(colorRamps) 
image(matrix(1:400, 20), col = blue2green2red(400) , axes = FALSE) 

enter image description here

+0

感謝您的回答,西蒙!不過,我會與其他人保持聯繫,因爲它不需要外部庫。 – Rodrigo

+0

@Rodrigo歡迎您! –