Yes, you want to add drop = FALSE
to your colour scale:
ggplot(subset(df,fruit == "apple"),aes(x = year,y = qty,colour = fruit)) +
geom_point() +
scale_colour_discrete(drop = FALSE)
Yes, you want to add drop = FALSE
to your colour scale:
ggplot(subset(df,fruit == "apple"),aes(x = year,y = qty,colour = fruit)) +
geom_point() +
scale_colour_discrete(drop = FALSE)