Scatter in the R in the time will often appear, point coincident more serious phenomenon, which we are looking for data law or observation data has a great disturbance.
Fortunately, in R, you can use the Geom_jitter () function to adjust and eliminate the overlap of points.
Geom_jitter (mapping = NULL, data = NULL, stat = "identity", Position = "jitter", ..., width = null, height = null, NA.RM = FALSE, show.legend = NA, Inherit.aes = TRUE)
As far as parameters are concerned, geom_jitter () and other functions are not very different, the special two parameters are Width,height
Width used to adjust the widths of point fluctuations
Height is used to adjust the altitude of the point fluctuation
Let's look at a concrete example.
Library (Ggplot2) P<-ggplot (Economics,aes (Pce,pop)) P+geom_point ()
It can be seen that the pop and PCE two data has a good correlation, but it is not possible to see how the concentration of each data location data.
At this point we can use the geom_jitter () to scatter the dots so that we may observe
P+geom_jitter (width=2000,height=20000)
It is obvious that points at lower positions are denser than points at higher locations.
If you add a color attribute, the geom_jitter effect becomes more pronounced.
Ggplot2 Geom Related Settings-jitter