I am making a plot using ggplot and cannot get the legend to show up. I’ve tried looking through other solutions but still can’t figure it out. It used to work for me, but I think that I may have used some code in the past that messed it up if that makes sense?
Plot0<-ggplot() +
geom_line(data=Sandusky8, aes(x=ProperDateTime, y=TKN), color='grey54')+
geom_line(data=SanduskyA, aes(x=ProperDateTime, y=TKN), color='blue')+
geom_line(data=SanduskyB, aes(x=ProperDateTime, y=TKN), color='red')+
scale_x_datetime(date_labels = "%Y")+
labs(title="Total Kjeldahl Nitrogen in the Sandusky River from 1974-2023")+
xlab("Year") + ylab("TKN (mg/L)")
Plot0 + theme(legend.position = "right")
resulting graph
New contributor
Alexandra Ferkul is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.