R interface: square vertices kill vertical edges
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Fix Released
|
High
|
Unassigned |
Bug Description
igraph looks extremely useful, thankyou, but I have come across an oddity in version 0.5.3 (R 2.10.0 patched, Windows Vista).
With the following commands the intention is that there should be vertical arrows between the layers, but they do not appear (see attached PDF). Investigating this, I found that the square.shift function in plot.shapes.R needs a small fix given below.
nodes <- data.frame(
labels <- c(NA,expression
nn <- as.character(
edges <- data.frame(
gg <- graph.data.
V(gg)$label <- labels
plot(gg,
One workaround appears to be to use any of "csquare", "rectangle" or "crectangle" as the shape instead of "square".
The problem appears to be in the following in square.shift from plot.shapes.R
m <- (y0-y1)/(x0-x1)
l <- cbind((
which causes the first and fifth elements to be NaN when x0==x1. Changing this to:
l <- cbind(x1-vsize/m , y1-vsize,
seems to fix the problem.
Changed in igraph: | |
importance: | Undecided → High |
status: | New → Confirmed |
Thanks for another amazing bug report! Fixed in revision #1575 (0.5-main) and #1764 (0.6-main).