This is related to the question here. However, I'm not trying to make a boxplot, but a scatterplot in ggplot2, but adding the argument geom_jitter()
adds black dots which seem to be non-related to my dataset.
Here's an example using the mpg data pack:
This is a simple scatterplot, that looks a bit "too clean"
gmpg<-ggplot(data=mpg, aes(x=hwy, y=cty))
gmpg+geom_point(aes(col=manufacturer))
Which produces this:
Now, if I add the argument jitter, this is what happens
gmpg+geom_point(aes(col=manufacturer))+geom_jitter()
I've tried reducing the alpha etc., but the black dots remain. What on earth are these and how do I remove them?
There is no need to add geom_point() in it,geom_jitter() is enough.
There is no need to assign a new aesthetic mapping in the
geom_*
functions. This should work: