I am relatively new using the ggplot package. I want to rename the legend of a plot using the names "Sp1" and "Sp2". I have tried to make it using the following code but I have been unable to do it.
This is the code:
t<-read.table ("covartimesfinal2.txt", header=T)
attach(t)
p <- ggplot(t,aes(x=Ratio,y=Time)) + geom_point(aes(shape=factor(Sp)))
p + geom_smooth(aes(linetype=factor(Sp), ),colour="black", method='lm',
se=F)+theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line =
element_line(colour = "black"))+
scale_shape_discrete(name ="Species",labels=c("Sp1", "Sp2"))
My aim is to get rid of the legend named "factor(Sp)" and make the numbers of the axis black and not grey.
Thanks in advance! Please find attached a sample plot