在R中,我有一個圍繞零的數據雲,並且一些數據在1左右,我想「重新調整」我的熱量顏色以區分較低的數字。這必須以彩虹方式完成,不要「離散的顏色」。我嘗試了image.plot中的中斷,但它不起作用。在r中調整顏色調色板
image.plot(X,Y,as.matrix(mymatrix),col=heat.colors(800),asp=1,scale="none")
我想:
lowerbreak=seq(min(values),quantile2,len=80)
highbreak=seq(quantile2+0.0000000001,max(values),len=20)
break=c(lowerbreak,highbreak)
ii <- cut(values, breaks = break,
include.lowest = TRUE)
colors <- colorRampPalette(c("lightblue", "blue"))(99)[ii]
也許'?colorRamp'插值顏色。 –
我試過,但我無法理解我該如何區分低價值 – gdlzzzz