5
Ví dụ Code:Loại bỏ yếu tố 'chấm' từ huyền thoại ggplot2
EmigProb<-c(rep(seq(0.1,0.8,length=5),4),rep(seq(0.1,0.8,length=5),4))
RemainEmigProb<-c(rep(0.2,5),rep(0.4,5),rep(0.6,5),rep(0.8,5),rep(0.2,5),rep(0.4,5),rep(0.6,5),rep(0.8,5))
Value<-rnorm(40,5,3)
Parameter<-c(rep("Survival",20),rep("Resight",20))
fakedata<-data.frame(EmigProb=EmigProb,RemainEmigProb=RemainEmigProb,Value=Value,Parameter=Parameter)
q <-ggplot(fakedata,aes(EmigProb,Value,shape=factor(RemainEmigProb),colour=factor(Parameter),linetype=factor(RemainEmigProb)))+scale_colour_discrete("Parameter")+scale_linetype_discrete("Remain Emigrant Probability")+scale_shape_manual("Remain Emigrant Probability",values=c(0,5,6,15))
q <- q + layer(geom="point")
q <- q + layer(geom="line")
q
Trong ví dụ này, có cách nào để loại bỏ các 'chấm' từ huyền thoại 'Parameter' cho 'Resight' và 'Survival'?
Cảm ơn! Đó là động lực tốt để nâng cấp phiên bản ggplot của tôi và cảm ơn liên kết tới những thay đổi mới! – user1399311