Description Usage Format Examples
ggplot2 stat for creating a sample of jittered points in a polygon
1 |
An object of class StatPolygon_jitter
(inherits from Stat
, ggproto
, gg
) of length 4.
1 2 3 4 5 6 7 8 9 | data(division)
data(crimes)
library(dplyr)
crime.map <- left_join(division, crimes, by=c("NAME"="State"))
ggplot(data = crime.map, aes(x = long, y = lat)) +
geom_polygon(aes(group = group), fill="grey90", colour="white", size = 0.5) +
stat_polygon_jitter(aes(long = long, lat = lat, group = STATEFP,
mapgroup = group, n = Population/200000)) +
ggthemes::theme_map()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.