geom_district_text | R Documentation |
Aggregates shapefile according to the group
aesthetic and positions labels
for each region defined by group
. By default, labels will be sized in rough
proportion to the available area.
geom_district_text(
mapping = NULL,
data = NULL,
position = "identity",
na.rm = FALSE,
adjust = 1,
check_overlap = FALSE,
parse = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
geom_district_label(
mapping = NULL,
data = NULL,
position = "identity",
na.rm = FALSE,
label.padding = ggplot2::unit(0.25, "lines"),
label.r = ggplot2::unit(0.15, "lines"),
label.size = 0.25,
check_overlap = FALSE,
parse = FALSE,
adjust = 1,
show.legend = NA,
inherit.aes = TRUE,
...
)
stat_district_coordinates(
mapping = NULL,
data = NULL,
geom = "text",
position = "identity",
na.rm = FALSE,
adjust = 1,
show.legend = NA,
inherit.aes = TRUE,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer |
position |
Position adjustment |
na.rm |
if |
adjust |
A multiplicative scaling factor for the default label sizes |
check_overlap |
If |
parse |
If |
show.legend |
Should this layer be included in the legends? |
inherit.aes |
If |
... |
Passed onto the underlying geoms. |
label.padding |
Padding around label |
label.r |
Radius of rounded corners |
label.size |
Size of label border (mm) |
geom |
The geometric object to use display the data |
a ggproto
object
library(ggplot2)
data(oregon)
ggplot(oregon, aes(group=county)) +
geom_district() +
geom_district_text() +
scale_fill_randmcnally() +
theme_map()
ggplot(oregon, aes(group=cd_2020)) +
geom_district(lwd=0.9, color="#442222") +
geom_district(aes(group=county), lwd=0.4, lty="dashed", fill=NA) +
geom_district_text(aes(group=county, label=toupper(county)),
size=2.2, check_overlap=TRUE) +
geom_district_text(adjust=2) +
scale_fill_penn82() +
theme_map()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.