briatte / ggnet

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

adjust edge lengths #36

Closed Sanrrone closed 5 years ago

Sanrrone commented 5 years ago

Hi, is there a way to adjust manually the distance between nodes?, I'm a bioinformatician and I would like to represent each node as a protein and the edge between proteins would be the similarity. Actually I only can plot the link between them but without any control on edges lengths.

thanks in advance

briatte commented 5 years ago

Hi @Sanrrone

ggnet2 allows you to modify node placement (which determines the distance between nodes) via its node placement argument.

If you need a bit more flexibility, you can try ggnetwork or, for even more options, ggraph -- but all packages will require that you select a node placement algorithm.

One last-resort solution might be to compute the distance between nodes yourself, and to pass that to the network plotting function. You can do that with ggnet2, as well as with ggnetwork, and probably also with ggraph.

Hope this helps!

Best wishes,

François