Hello all,
I am making a graph in ggplot2 (geom_line
) with two lines and both show up within the legend. However, I am also making a change linetype (scale_linetype_manual(values=c("solid", "twodash"))
) and a change the names of a legend (scale_color_discrete(labels =expression(widehat(gamma)[list(1,k)]^(H), widehat(gamma)[list(1,k)]^(CDM)))
), however, I have got two legends. Is there a way to remove the first legend (Hillــــــــ , CDM------) and change linetype the second legend?
df1 <- data.frame(k, y=estimatorHill, Legende="Hill")
df2 <- data.frame(k, y=estimatorCDM, Legende="CDM")
dfF<- rbind(df1, df2)
library(ggplot2)
estimators <- ggplot(dfF, aes(k, y, colour=Legende, linetype=Legende)) +
geom_line(aes())+
labs(x = "k", y="Estimators" )+
ylim(c(0, 1.1))+
geom_hline(yintercept=Gamma1)+
scale_color_discrete(labels = expression(widehat(gamma)[list(1,k)]^(H),
widehat(gamma)[list(1,k)]^(CDM)))+
#scale_linetype_manual(values=c("solid", "twodash"))+
theme( legend.title = element_blank())
estimators