Hello dears,
I'm trying to control linetypes and colours of lines in a plot, but without sucess.
I want that the linetype and colour appear in the legend, but until now I only can did it to linetype. Follow my code below:
ggplot()+
geom_line(data=original_spectro, aes(x=Comprimento_de_onda_nm, y=Ponto_01,
linetype="Point 01"), size=1.2)+
geom_line(data=original_spectro, aes(x=Comprimento_de_onda_nm, y=Ponto_02,
linetype="Point 02"), size=1.2)+
geom_line(data=original_spectro, aes(x=Comprimento_de_onda_nm, y=Ponto_03,
linetype="Point 03"), size=1.2)+
geom_line(data=original_spectro, aes(x=Comprimento_de_onda_nm, y=Ponto_04,
linetype="Point 04"), size=1.2)+
xlab('Wavelength (nm)')+ylab('Reflectance (dimensionless)')+
ggtitle("Reflectance curve", subtitle = "November, 2017")+
theme(
plot.title=element_text(hjust=0.5, face='bold', size = 14),
plot.subtitle = element_text(hjust=0.5, size = 12)
)+
theme(legend.key.width=unit(2,"cm"),legend.key.height=unit(0.5,"cm"),
legend.position = c(0.85, 0.75))+
labs(linetype = "Sampling points")