I want to change the shape and size of a points on 2 lines and I can do that but a second legend appears.
When you run this code you will see 2 legends. I only want the "variable" legend.
library("ggplot2")
MyData<-data.frame(time= c(1,2,3,1,2,3), value = c(.4,.6,.7,.1,.2,.3), variable = c("company a","company a","company a","company b","company b","company b") )
MyData$pointsize <- ifelse(MyData$time==2, 5, 1)
MyData$shape <- ifelse(MyData$time==2, 4, 7)
MyData
ggplot(MyData, aes( x = time, y=value,colour=variable, group= variable) ) + geom_line() + geom_point(aes(shape = MyData$pointsize,size = MyData$pointsize) )+
scale_shape_identity()
How do I remove the legend for Mydata$PointSize?
Thank you!