SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

Moving directional edges between two nodes closer together #58

Closed phoebeachapman closed 2 years ago

phoebeachapman commented 2 years ago

Hello,

I've created a network graph (using an edgelist imported from a .csv) that has two weighted directional edges between each pair of nodes. I would like to move the two edges between each pair closer together to reduce overlap where the various edges join the nodes and improve readability. I've been trawling through the documentation and can't find a way to do this, though I've seen it in example graphs around the place so I suspect it's possible. Example:

qgraph(input_PTZ, parallelEdge = TRUE, layout = "spring")

Draft_1_PTZ_leg

For example, say the space between the two edges running between nodes 1 and 2 was (hypothetically) 1cm, I would like to reduce that gap to say 0.5cm (for all cases on the graph). You can see in the current format the various edges are overlapping close to each node. I've tried increasing the size of the nodes using vsize but the distance between the edges increases proprtionately - maybe there is a way to specify where the edges enter/leave the node? Any assistance appreciated

SachaEpskamp commented 2 years ago

You can use the parallelAngleargument for this:

qgraph(matrix(1,4,4),directed=TRUE,parallelEdge=TRUE,parallelAngle = 0.1*pi)