0

this is sure a simple question, but I have not find a quick and easy solution. I just want to remove one aes from the legend, for example in the figure, I don't want that the "2 dot" appear:

enter image description here

BTW, that's the code of the plot:

ggplot(subset(df, df$ID %in% c( "B4F", "B3F", "B33F", "B2F", "B0F")), 
       aes(Date, SO4, color=ID))+
  geom_smooth(method="loess", se=F, size=1)+
  geom_point(data=subset(df_1, df_1$ID %in% c( "B4F", "B3F", "B33F", "B2F", "B0F")),
             aes(Date, SO4, color=ID, size=2, legend=FALSE))+
  scale_x_date(labels= date_format("%Y"), breaks=date_breaks("year"))+
  xlab(NULL)
matteo
  • 4,683
  • 9
  • 41
  • 77

1 Answers1

1

Remove the size=2 from the aes. Hence, change

geom_point(data=subset(df_1, df_1$ID %in% c( "B4F", "B3F", "B33F", "B2F", "B0F")),
             aes(Date, SO4, color=ID, size=2, legend=FALSE))

to

geom_point(data=subset(df_1, df_1$ID %in% c( "B4F", "B3F", "B33F", "B2F", "B0F")),
                 aes(Date, SO4, color=ID, legend=FALSE), size=2)

In the latter code, size=2 is still inside geom_point, but outside aes.

Sven Hohenstein
  • 80,497
  • 17
  • 145
  • 168