briatte / ggnet

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

ggnet2: argument `arrow.gap` introduces shifting of the edges #17

Closed grigory93 closed 8 years ago

grigory93 commented 8 years ago

Network plot without arrows:

net = network(rgraph(10, tprob = 0.25), directed = TRUE)
ggnet2(net)

image After adding arrows with arrow.size:

ggnet2(net, arrow.size = 20)

image Observe shifting of the edges or similar questionable effect after adding arrow.gap only:

ggnet2(net, arrow.size = 20, arrow.gap = 0.05)

image

Running with GGally 1.0.1, ggplot2 2.1.0, grid 3.4.0

briatte commented 8 years ago

Interesting bug, thanks. Arrows are a pain to draw (somewhat) properly.

May I recommend that you try ggnetwork to see if that helps? The syntax should also be a bit more intuitive if you know ggplot2.

aterhorst commented 8 years ago

I experienced the same issue with arrow.gap. I did try ggnetwork as suggested but this requires a lot more hacking to get to work. I think ggnet2 is easier/nicer to use for quick plots. I hope you get around to fixing this bug! Many thanks for the great work.

aterhorst commented 8 years ago

I do not know where to set arrow.gap in ggnetwork. Please advise.

rbirkelbach commented 8 years ago

I also have this bug. I'm using the most recent version.

briatte commented 8 years ago

@grigory93 @aterhorst @rbirkelbach – the bug has been fixed by myself within ggnet, and by @heike within GGally (thanks!).

To use immediately, you can either use ggnet instead of GGally, or install GGally from GitHub:

library(devtools)
install_github("briatte/ggnet") # or
install_github("ggobi/ggally")

The GGally should soon be updated to fix the bug after which you should be able to install it from CRAN and not see the bug anymore.

Sorry for the slow reply to all.