この分野で質問をしたのは私が初めてではないことはわかっていますが、特定の困惑に対する解決策を見つけることができませんでした. これが私の問題の簡略化された例です。
data<-data.frame(Est=c(1:20,1:20),Measured=c(1:5,5:9,1:6,3:6,1:6,3:6,1:4,4,4:8),variable=c(rep("Plot1",20),rep("Plot2",20)))
p<-ggplot(data,aes(y=Est,x=Measured,shape=variable))
p<- p + geom_point(stat="identity") +coord_fixed(xlim=c(0,25),ylim=c(0,25)) + theme_bw()
p #If you plot the figure at this point, the points stand alone in the legend
p<-p+ geom_abline(intercept=0,slope=1,aes(linetype="1:1",color="1:1"),show_guide=TRUE)
p # Once the geom_abline is added, there are lines through the points. :(
p<-p+scale_color_manual(name="Lines",
values=c("1:1"="black"))
p<- p + scale_linetype_manual(name="Lines",
values=c("1:1"=2))
p<-p + scale_shape_manual(values=c(0,20), name = "")
p<- p+xlab(expression(paste("Measured volume(",ducks^{3},"",ha^{-1},")",sep="")))
p<-p+ ylab(expression(paste("Estimated volume (",ducks^{3},"",ha^{-1},")",sep="")))
ご覧のとおり、ポイントの凡例にはスラッシュが含まれています (これは実際には線だと思います)。
サンプル コードには線と線種が 1 つしかありませんが、作成した実際の図にはさまざまな色と線種の 5 つの異なる線が含まれているため、色と線種を指定して複数の geom_abline 呼び出しを含めることができるソリューションが必要です。
いいえ、私はアヒルの何かの量を実際に測定しているわけではありませんが、それを研究するのは本当に面白いでしょう...