briatte / ggnet

Network visualization with ggplot2
https://briatte.github.io/ggnet/
194 stars 33 forks source link

fixing coordinates of vertices #22

Closed khanna7 closed 8 years ago

khanna7 commented 8 years ago

I am plotting the same network (consisting of identical node and edge sets), with different node colorings to show different structure. Each plot assigns the nodes different coordinates on the figure; I'd like to make the coordinates the same, so that a reader sees to identical pictures in terms of the node and edges, but different colorings of the same. In the gplot function in the sna package, coordinates can be fixed using the coord argument. Is there a way to fix coordinates in ggnet?

For an example, see the bottom two figures at http://rpubs.com/khanna7/186429. I'd like the two networks to look the same, aside from the node features that are highlighted.

khanna7 commented 8 years ago

I was able to fix coordinates on the second network by obtaining a matrix of the coordinates on the first, and using the mode argument. Thank you for including this helpful feature!