Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout_with_drl: fixing nodes is not working #397

Closed
vtraag opened this issue Jun 12, 2020 · 2 comments
Closed

layout_with_drl: fixing nodes is not working #397

vtraag opened this issue Jun 12, 2020 · 2 comments
Milestone

Comments

@vtraag
Copy link
Member

vtraag commented Jun 12, 2020

Using the fixed argument does not work as intended. According to the C core documentation, the fixed argument is also not properly implemented, this should also be clarified in the R documentation.

@SimonMontfort
Copy link

SimonMontfort commented Jun 12, 2020

I would like to have the first node set in a two mode network fixed while optimising the positions of the second node set. Is there any way of doing this? I have tried the following and more which I document in the igraph forum (see link below):

I noticed this error when running this example:

library(igraph)
## data
# sample graph and transform to two-mode network
g <- sample_pa(26, m=2)
tm <- get.adjacency(g, names=FALSE)
g <- graph_from_incidence_matrix(as.matrix(tm, time = max(events$time)))
# lon lat data for the first node-set of the two-mode network
lon <- c(8.156847,9.416345,9.368596,7.625363,7.702396,7.615194,7.073961,6.133073,9.06578,9.628154,7.156132,8.110061,6.780079,8.405384,8.24331,9.275258,8.591709,7.639228,8.756584,9.092979,8.808903,8.628586,6.657902,7.604754, 8.537324, 8.655167)
lat <-c(47.40973,47.31729,47.36624,46.82192,47.45168,47.56484,46.71842,46.22047,46.9811,46.65624,47.3507,47.06778,46.99553,46.92681,46.85235,47.23359,47.71354,47.30422,47.06192,47.56883,46.29559,46.77191,46.57009,46.20956,47.1573,47.41282)

# problem:
co <- layout_with_drl(g, use.seed = T, seed = cbind(lon, lat), fixed = T)

error:

Error in layout_with_drl(g, use.seed = T, seed = cbind(lon, lat), fixed = T) : 
  At DensityGrid.cpp:228 : Exceeded density grid in DrL, Internal DrL error

I would like to plot:

plot(g, layout=co, vertex.size=30, edge.arrow.size=0.2,
 vertex.label="", rescale=FALSE,
 xlim=range(co[,1]), ylim=range(co[,2]), vertex.label.dist=0,
 vertex.label.color="red", vertex.color = ifelse(V(g)$type == F, "red", "blue"))

link to igraph forum on the question: https://igraph.discourse.group/t/fix-position-of-nodes-with-layout-with-fr/290/13

@szhorvat szhorvat added this to the 1.3.0 milestone Mar 18, 2022
@szhorvat
Copy link
Member

fixed argument is removed in C core now, should be removed in R too (at least deprecated in 1.3)

@ntamas ntamas closed this as completed in ed327bc Mar 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants