我創造了R A barplot和想要的顏色由杆高度各條(計數)顏色Barplot伯爵
目前我有:
z=rnorm(n,1)
Z=runif(n)
h=barplot(Z)
我有照片,但沒有足夠的聲譽張貼他們。 因此,這裏是MATLAB中的例子: MatLab-Color bars by height
我創造了R A barplot和想要的顏色由杆高度各條(計數)顏色Barplot伯爵
目前我有:
z=rnorm(n,1)
Z=runif(n)
h=barplot(Z)
我有照片,但沒有足夠的聲譽張貼他們。 因此,這裏是MATLAB中的例子: MatLab-Color bars by height
試試這個,
library(ggplot2)
d = data.frame(x = rnorm(100))
ggplot(d) + geom_bar(aes(x, fill = ..count..))
喜歡它。謝謝! – crock1255
除巴蒂斯特的GGPLOT2解決方案,這是一個使用barplot
一個簡單的例子:
Z <- sample(20,15,replace = TRUE)
barplot(Z,col = heat.colors(max(Z))[Z])
產生類似這個:
這太好了。非常感謝! – crock1255
錯誤:找不到函數「rand」 – TMS
對不起rand是matlab代碼。我想我用過rnorm – crock1255