igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] igraph-help Digest, Vol 82, Issue 15


From: Evan Alymers
Subject: Re: [igraph] igraph-help Digest, Vol 82, Issue 15
Date: Sun, 19 May 2013 12:29:18 -0400

Thank you, Gabor. That's a big help. 

For anyone else, here are 2 lines you can add. "Faithful" distances mean that equal distances take up equal screen space.

s = matrix(0, nrow=3, ncol=3)
s[1,2] = 0.2
s[1,3] = 0.2
s[2,3] = 20
s = s + t(s)

l   = layout.drl(g, weights=E(g)$weight)

#l   = scale(l, center=T, scale=F) #uncomment this to reduce excessive white space
lim = range(l)

plot(g, layout=l, rescale=F, xlim=lim, ylim=lim)





On Sun, May 19, 2013 at 12:00 PM, <address@hidden> wrote:
Send igraph-help mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.nongnu.org/mailman/listinfo/igraph-help
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of igraph-help digest..."

Today's Topics:

   1. Faithful distances in weighted plots? (Evan Alymers)
   2. Re: Faithful distances in weighted plots? (G?bor Cs?rdi)


---------- Forwarded message ----------
From: Evan Alymers <address@hidden>
To: address@hidden
Cc: 
Date: Sat, 18 May 2013 17:58:21 -0400
Subject: [igraph] Faithful distances in weighted plots?
For laying out a weighted network, the simplest test case seems like a (very) isosceles triangle. However, when I plot this, sometimes it looks isosceles and sometimes it looks equilateral. Is there a better layout to use?

Thank you

s = matrix(0, nrow=3, ncol=3)
s[1,2] = 0.2
s[1,3] = 0.2
s[2,3] = 20
s = s + t(s)

g = graph.adjacency(s, mode="undirected", weighted=TRUE, diag=FALSE)
plot(g)

l = layout.drl(g, weights=E(g)$weight)
plot(g, layout=l)




---------- Forwarded message ----------
From: "Gábor Csárdi" <address@hidden>
To: Help for igraph users <address@hidden>
Cc: 
Date: Sat, 18 May 2013 18:07:00 -0400
Subject: Re: [igraph] Faithful distances in weighted plots?
I guess this is because igraph rescales the coordinates to c(-1,1), both vertically and horizontally, so if the short (=high weight) edge happens to be close to vertical/horizontal, then it is rescaled, and will get longer.

You can use the raw coordinates to avoid this, i.e. plot(..., rescale=FALSE).

Gabor


On Sat, May 18, 2013 at 5:58 PM, Evan Alymers <address@hidden> wrote:
For laying out a weighted network, the simplest test case seems like a (very) isosceles triangle. However, when I plot this, sometimes it looks isosceles and sometimes it looks equilateral. Is there a better layout to use?

Thank you

s = matrix(0, nrow=3, ncol=3)
s[1,2] = 0.2
s[1,3] = 0.2
s[2,3] = 20
s = s + t(s)

g = graph.adjacency(s, mode="undirected", weighted=TRUE, diag=FALSE)
plot(g)

l = layout.drl(g, weights=E(g)$weight)
plot(g, layout=l)



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




--
Gabor Csardi <address@hidden>     MTA KFKI RMKI

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]