我的条形图中的颜色有一些问题。我有一个 4x4 矩阵“allmat”:
A B C D
L 0.10260 0.0215700 3.017e-01 0.06917
F 0.09840 0.0206900 2.009e-01 0.11450
M 0.14100 0.0065630 3.252e-01 0.35050
G 0.02121 0.0006811 5.454e-06 0.13810
要在一张图中绘制列,我使用:
mp<-barplot(allmat,beside=T,axisnames=F,col=c("red","black","green","blue"))
mtext(1,at=mp,text=c("L","F","M","G"),line=0,cex=0.5)
mtext(1,at=colMeans(mp),text=c("A","B","C","D"),line=2)
我得到的是每一行都有相同的颜色,但我希望列的颜色相同。我怎么做?
最好的,
欧根