stat_cities | R Documentation |
Clips the interstates and cities datasets to the bounding box of the map and plots them.
stat_cities(
mapping = NULL,
data = NULL,
geom = ggplot2::GeomSf,
position = "identity",
na.rm = FALSE,
adjust = 1,
min_pop = 1e+05,
show.legend = NA,
inherit.aes = TRUE,
...
)
stat_interstates(
mapping = NULL,
data = NULL,
geom = ggplot2::GeomSf,
position = "identity",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer |
geom |
The geometric object to use display the data |
position |
Position adjustment |
na.rm |
if |
adjust |
A multiplicative scaling factor for the default label sizes |
min_pop |
The minimum population a city must have had in 2006 to be shown. |
show.legend |
Should this layer be included in the legends? |
inherit.aes |
If |
... |
Passed onto the underlying geoms. |
a ggproto
object
library(ggplot2)
data(oregon)
ggplot(oregon, aes(group=cd_2020)) +
geom_district() +
stat_interstates(size=1.4, color="#0044aa55") +
stat_cities(geom="text", min_pop=130e3, fontface="bold", adjust=0.8) +
scale_fill_penn82() +
theme_map()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.