我尝试将horiz=FALSE
设置为TRUE,但它只是给了我
我的代码是:
mydata <- data.frame(
row.names =c(100),
Male =c(50),
Female =c(50))
x <- barplot(t(as.matrix(mydata)), horiz=TRUE, axes=FALSE, col=c("yellow", "green"),
legend=TRUE, border=NA, xlim=c(0,8), args.legend=
list(bty="n", border=NA),
ylab="Cumulative percentage", xlab="Village number")
text(x, mydata$Male-10, labels=round(mydata$Male), col="black")
text(x, mydata$Male+10, labels=100-round(mydata$Male))