|
group = c(rep("A", 3), rep("B", 6), rep("C", 5),rep("D", 4))
value<-c(rnorm(3,mean=1,sd=4),rnorm(6,mean=0,sd=1),rnorm(5,mean=2,sd=2),rnorm(4,mean=5,sd=1))
tt.data<-data.frame(group,value)
head(tt.data)
library(ggplot2)
ggplot(tt.data,aes(group,value)) + geom_point()
tt.data$group <- factor(tt.data$group, levels=c("B", "A", "C","D"), ordered=TRUE)
ggplot(tt.data,aes(group,value)) + geom_point()
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 08:28
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社