briatte / ggnetwork

Geoms to plot networks with ggplot2
https://briatte.github.io/ggnetwork/
146 stars 28 forks source link

geom_nodes() not sizing by nodal attributes #60

Open EvanUp opened 4 years ago

EvanUp commented 4 years ago

geom_nodes() doesn't seem to be sizing nodes properly when its fed sizes that are related to node attributes.

## repex
data(flo)
n <- network(flo, directed = FALSE)
n%v%'labels' = paste(n%v%'vertex.names', sna::degree(n))

# each time i run this the size of each node changes
ggplot(n, aes(x, y, xend = xend, yend = yend)) +
  geom_edges(colour = "steelblue") +
  geom_nodes(size = degree(n), shape = 21, colour = "steelblue", fill = "white") +
  geom_nodetext(aes(label = labels))+
  theme_blank()
Plot_Zoom

P.S. thank you for creating and sharing this package. It's my favorite network visualization tool.