I am trying to plot multiple line plots with different line types. The lines type can be seen in plot view but I am unable to visualize in legends. Kindly find my code below and data in given link:
https://docs.google.com/spreadsheets/d/19vMlgAS2bixehz-v28QXw7VgPdiD7u54/edit?usp=sharing&ouid=108208055491136780352&rtpof=true&sd=true
> data <- read_excel("NF(45)_2040_2059.xlsx", sheet = 1)
> colnames(data)<- c("Date","Observed","RCM1","RCM2","RCM3","RCM4","RCM5","RCM6","RCM7","RCM8","RCM9","RCM10","RCM16","Ensemble")
> set.seed(1234)
> p1 <- data %>%
> mutate(Date = dmy(Date)) %>%
> ggplot(aes(x=Date)) + geom_line(data= data,aes(y=data$RCM1,color="RCM1",linetype = "RCM1"),size=1)+ geom_line(data= data,aes(y=data$RCM2,color="RCM2",linetype = "RCM2"),size=1)+
> geom_line(data= data,aes(y=data$RCM3,color="RCM3",linetype = "RCM3"),size=1)+ geom_line(data= data,aes(y=data$RCM4,color="RCM4",linetype = "RCM4"),size=1)+
> geom_line(data= data,aes(y=data$RCM5,color="RCM5",linetype = "RCM5"),size=1)+ geom_line(data= data,aes(y=data$RCM6,color="RCM6",linetype = "RCM6"),size=1)+
> geom_line(data= data,aes(y=data$RCM7,color="RCM7",linetype = "RCM7"),size=1)+ geom_line(data= data,aes(y=data$RCM8,color="RCM8",linetype = "RCM8"),size=1)+
> geom_line(data= data,aes(y=data$RCM9,color="RCM9",linetype = "RCM9"),size=1)+ geom_line(data= data,aes(y=data$RCM10,color="RCM10",linetype = "RCM10"),size=1)+
> geom_line(data= data,aes(y=data$RCM16,color="RCM16",linetype = "RCM16"),size=1)+ geom_line(data= data,aes(y=data$Ensemble,color="Ensemble",linetype = "Ensemble"),size=1.5)+
> ggtitle("Precipitation STD(NF45)") +
> labs(x="time",
> y=" Runoff",
> linetype = "Legends",
> color = "Legends")+
> scale_color_manual(name="Legends",breaks = c("Observed","RCM1","RCM2","RCM3","RCM4","RCM5","RCM6","RCM7","RCM8","RCM9","RCM10","RCM16","Ensemble"),values = c('RCM1' = 'black','RCM2' = 'red',"RCM3"= "lightsalmon2","RCM4"= "brown","RCM5"="cyan",
> "RCM6"="steelblue","RCM7"="dodgerblue4","RCM8"="limegreen",'RCM9' = 'goldenrod1','RCM10' = 'purple4',"RCM16"="burlywood4","Ensemble"="black"))+
> scale_linetype_manual(breaks = c("Observed","RCM1","RCM2","RCM3","RCM4","RCM5","RCM6","RCM7","RCM8","RCM9","RCM10","RCM16","Ensemble"),
> values = c('RCM1' = 'solid','RCM2' = 'dashed',"RCM3"= "solid","RCM4"= "dashed","RCM5"="solid","RCM6"="dashed","RCM7"="solid","RCM8"="dashed",'RCM9' = 'solid','RCM10' = 'dashed',"RCM16"="dashed","Ensemble"="solid"))+theme_bw()