qgraph icon indicating copy to clipboard operation
qgraph copied to clipboard

Arrows not drawn when arrowheads are larger than the distance between two nodes

Open Spiritspeak opened this issue 3 months ago • 0 comments

Arrows are not drawn when the arrowheads are larger than the distance between two nodes. No warning is given when this happens.

This is a significant issue for large networks with directed edges.

plotmat<-structure(c(-0.151964453714227, 0.188629320176558, 0.121743195585023, 
                     0, 0, 0, -0.101830148079156, 0.13192730398335, 0, 0, 0, 0, -0.357134615141955, 
                     0, 0, 0.117149095788058, 0, 0, 0, 0, 0.133614246458278, 0, 0, 
                     0, -0.197311743067261, 0, 0, 0, 0, -0.107937369497387, 0, 0, 
                     0.120466966304739, 0, 0, 0, 0, 0, 0, 0.166243637686105, 0.121425778003196, 
                     0.0825009744208168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.118665391799907, 
                     0.122282765378992, 0.147819862328399, 0.104538059432643, 0, 0, 
                     0, 0, 0, 0, 0, 0, 0.111800707477139, 0, 0.212812868405501, 0, 
                     0, -0.120902851105233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17122732181377, 
                     0, 0.150003782208279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.112579832629073, 
                     0, 0, 0, 0, -0.0999046888711934, 0.110654965123838, 0, 0, -0.0860836293963429, 
                     0, 0, 0.182158344573799, 0, 0, 0, 0, 0, 0.0902821901465538, 0, 
                     0, -0.144220482233881, -0.0950541324261894, 0, 0, 0.17308079207966, 
                     0, 0.114344959415095, 0, 0, 0, 0, -0.0867562357692116, 0, 0, 
                     0, 0, 0, 0.10257051700653, 0, 0.115445928758904, 0, 0, 0, -0.0689992434221203, 
                     -0.0895637720912313, -0.0961439806952883, 0, 0.101272874836655, 
                     0.0742826122841168, 0, 0.123699845117562), dim = c(12L, 12L), dimnames = list(
                       c("sqrtCalories", "Hunger", "DesireToEat", "Happy", "Excited", 
                         "Relaxed", "StressedNervousTense", "Irritated", "Worried", 
                         "Depressed", "Bored", "Dissatisfied"), c("sqrtCalories", 
                                                                  "Hunger", "DesireToEat", "Happy", "Excited", "Relaxed", "StressedNervousTense", 
                                                                  "Irritated", "Worried", "Depressed", "Bored", "Dissatisfied"
                         )))
# Does not draw some arrows
png("bigarrows.png",width=1000,height=1000)
qgraph(plotmat,asize=20)
dev.off()

bigarrows

# Does draw them
png("normarrows.png",width=1000,height=1000)
qgraph(plotmat,asize=10)
dev.off()

normarrows

Note how the red arrow is visible in this network, but missing from the one with large arrowheads.

Spiritspeak avatar Mar 14 '24 15:03 Spiritspeak