Skip to content

Fill color changes to black when plotting sfc objects consisting of MULTIPOLYGONs and POLYGONs #945

@ghost

Description

Hi all,

library(sf)
# two arbitrary multipolygons:
p1 <- st_polygon(list(matrix(c(0, 0, 0, 1, 1, 1, 1, 0, 0, 0), ncol = 2, byrow = TRUE)))
mp1 <- c(p1, p1 + c(2, 2))
p2 <- p1 + c(4, 4)
mp2 <- c(p2, p2 + c(2, 2))

# An `sfc` object with only multipolygons plots nicely:
plot(st_sfc(mp1, mp2))
 
# The fill color of the polygons changes to black when mulitpolygons and polygons are mixed:
plot(st_sfc(mp1, p2))
 
# Specififaction of the `col` argument still works though:
plot(st_sfc(mp1, p2), col = NA)

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions