Geom_boxplot in ggplot draws parallel group box line graph

Geom_boxplot in ggplot draws parallel group box line graph

Data Format

#*转变因子的一部最重要*
setwd("。。。。。")
data1 <- read.table("clipboard",header=T,sep='\t')
####转变为因子,才会显示分组
data1$dot<-as.factor(data1$dot)
data1$tw_ns<-as.factor(data1$tw_ns)
######
library(ggplot2)
p <- ggplot(data1,aes(x=tw_ns,y=error))+
     geom_boxplot(aes(colour=dot ))  
###colour等同于fill
p

The following is the result of whether the conversion factor
Insert picture description hereInsert picture description here

Published 7 original articles · liked 0 · visits 444

Guess you like

Origin blog.csdn.net/chengdehe/article/details/104786305