我试图将以下示例中的值轴限制为从 0 到 1,但它似乎没有接受它。我哪里错了?
library(ggplot2)
tmp<- data.frame(testname=c("b","b","a","a","c","c"), variable=c(40,50,40,50,40,50), value=c(0.5,0.6,0.7,0.8, 0.4, 0.8))
tmp
tmp$testname <- factor(tmp$testname, levels=unique(as.character(tmp$testname)))
ggplot(tmp, aes(testname, value)) + geom_point(aes(group=variable, colour= variable), ) + theme_bw() + coord_cartesian(xlim=c(0, 1)) +
coord_flip()