ggseg / ggsegJHU

Other
4 stars 0 forks source link

ggsegJHU visualisation problem #1

Open crojrj opened 2 years ago

crojrj commented 2 years ago

I am getting following error: Error in CPL_geos_is_empty(st_geometry(x)) : Evaluation error: IllegalArgumentException: Points of LinearRing do not form a closed linestring.

After trying this: plot(jhu) + theme(legend.position = "bottom", legend.text = element_text(size = 7)) + guides(fill = guide_legend(ncol = 2))

npenzel commented 2 years ago

Hi, I am having the same problem. Did you find a solution by now? Best, Nora

crojrj commented 2 years ago

Worked for me: p2 <- ggplot(data=jhu$data$geometry) + geom_sf(aes(fill=jhu$data$region)) p2 <- p2 + theme(legend.position = "bottom", legend.text = element_text(size = 7)) + guides(fill = guide_legend(ncol = 2))

just replace fill with your data.

crojrj commented 2 years ago

this line also might be needed:
jhu$data$geometry <- st_sf(st_cast(jhu$data$geometry, "POLYGON"))