When reading scientific papers I often come across plots where points are jittered without overlaping each other. I suspect many of them are drawn with a program called GraphPad Prism, but surely there must be a way to do the same in R. Although it is not perfect (as with the red points below) I think it looks much better than random jittering.

If anybody knows how to do this, preferably using some basic function, I’d be very happy to know.
Here is a ggplot2 solution using
geom_dotplot():