我想制作一个这样的情节:
尽管我认为我非常接近,但我无法管理细分或标签。这就是我所拥有的。
ggplot(df1,aes(x=treatment , y=option)) +
geom_boxplot()+
geom_point(aes(colour=morph))+
geom_segment(aes(x=x,y=y, xend=xend,yend=yend))+
ylab("Escape strategy")+
scale_x_discrete(labels=c("Leaf litter","Sand"))+
theme(panel.background = element_rect(fill='transparent', colour='black'),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.title.x = element_text(colour="black", size=14),
axis.text.x = element_text(angle=0, vjust=0.5,colour="black", size=14),
axis.title.y = element_text(colour="black", size=14),
axis.text.y = element_text(angle=0, vjust=0.5,colour="black", size=14)
)+
theme(legend.position=c(0.5,0.3),
legend.justification=c(1,1),
legend.key = element_rect(fill = 'transparent',),
legend.background = element_rect(fill = 'transparent',),
legend.text = element_text(size = 12))
df1可以从:https://www.dropbox.com/s/2998kp9mx1phiav/df1.csv?dl=0获得 希望任何人都有提示。