Skip to content

report a bug of geom_sf: the legend does not appear, even if show.legend is TRUE #3636

Closed
@microly

Description

@microly

According to the documentation, the legend of geom_sf should be always showed if show.legend is TRUE.
However, if there is no aesthetics other than geometry, the legend of geom_sf does not appear even if show.legend is TRUE.
Below is an example:

library(ggplot2)
library(sf)

nc <- st_read(system.file("shape/nc.shp", package = "sf"))
ggplot(nc) + geom_sf(show.legend = TRUE)

a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions