It is easier to explain what am I trying to do through the following reproducible example:
library(sf)
library(brazilmaps)
library(spdep)
# loading cities map
cities_mg <- brazilmaps::get_brmap(geo = 'City',
geo.filter = list(State = 31),
class = 'sf')
# creating adjacency matrix (neighborhood graph)
nb_mg <- spdep::poly2nb(cities_mg)
# plotting
coords_mg <- st_coordinates(st_centroid(st_geometry(cities_mg)))
par(bg = '#2E2E2E')
plot(nb_mg, coords_mg, pch = 19, cex = .6, lwd = .4,
col = '#00C040', points = T)
This piece of code generates the following plot
What I would like to do, is coloring the nodes (or vertices) with the same color as the edges. Is it possible?
Thank you in advance.