我有一些数据如下:
mydata <- rbind(c(5,4,3,7,6),
c(1,4,5,2,2))
colnames(mydata) <- c("Ali","Bala","Chun Li","Danny","Esther")
我想对我的数据进行分组条形图:
x <- barplot(mydata, beside=T, las=2,
col=c("yellow2", "brown2"),
main="Chocolates Eaten by Students",
ylab="No. of chocolates")
legend("topright", cex=0.7,
legend = c("White", "Dark"),
fill = c("yellow2", "brown2"))
如何将x轴标签顺时针旋转45度(从当前位置开始)?
注意:使用以下内容并未提供我想要的输出。
text(cex=1, x=x+0.5, y=0, colnames(mydata), xpd=TRUE, srt=45, pos=2)