Skip to content

stat_sf(geom = "text") #2111

Closed
Closed
@cpsievert

Description

@cpsievert

I'd expect something like this to work

library(ggplot2)
library(sf)
library(albersusa)
usa_sf <- st_as_sf(usa_composite("laea"))
centroids <- st_centroid(usa_sf)

ggplot() + 
  geom_sf(data = usa_sf) + 
  stat_sf(data = centroids, aes(geometry = geometry, label = name), geom = "text")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions