5
ggplotに傾向線を追加したいが、重要な関係についてのみ追加する。 geom_smooth
またはstat_smooth
は、各グループにトレンドラインを追加しますが、トレンドラインを取得するグループと、そうでないグループを指定します。私のスクリプトの例以下は特定のグループのみについて回帰直線を追加する
:
plot20<-ggplot(data, aes(x=data$Density, y=data$Total.degrees, color=Species, shape=Species))
+ geom_point(size=3)
+ scale_shape_manual(values=shapeset)
+ scale_colour_manual(values=colorset)
+ theme(legend.position="none")
+ geom_smooth(method=lm, se=FALSE)
ありがとうございました! – user2170248