Dealing with over-plotting, jittering points
Size reduction is never an option when there are too many points sharing the exact same coordinates; it simply is not the right tool for the job. A clear option therefore is to jitter the data, that is, add a little noise to the data so that the points move around a little bit and the over-plotting kind of wears off.
Two points must be highlighted here. Jittering may be a good way to adjust the plot but not to adjust the data, so do not use jittered data for modeling and always be honest when transformations of that nature take place. Second point is that as long it may work pretty well when many points share coordinates. Although, if too many points are only close enough but do no share same coordinates there is a chance that jittering will work very badly.
Now let's go back to the iris data set and demonstrate how this technique can be applied using ggplot2
, ggvis
and plotly
.
How to do it...
- With
ggplot2
, setpotion = 'jitter'
in order to obtain...