[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Drawing MST ???
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Drawing MST ??? |
Date: |
Thu, 16 Aug 2012 19:00:10 -0400 |
Hi Jameson,
On Thu, Aug 16, 2012 at 5:04 PM, jameson mcfarlane
<address@hidden> wrote:
> Hi Everyone,
> I currently have a minimum spanning tree (MST) looking like
> this: see attachment msta.gif.
> But I want it to look like this: mstb.gif
What do you mean exactly by 'this'? Same font? Vertex sizes? Layout?
Labels? Color? Image size? Something else?
Or really exactly like mstb.gif? Then just use mstb.gif. :)
G.
> Here is the code (below) using igraph. I'd greatly appreciate any help.
> Thank you
>
> library(igraph)
> tab <- read.csv("NewJam6.csv")
> tab <- tab[,-1]
> g <- graph.adjacency(as.matrix(tab), weighted=TRUE)
> V(g)$label <- V(g)$name
> mst <- as.undirected(minimum.spanning.tree(g))
>
> lay <- layout.reingold.tilford(mst, root=which.max(degree(mst))-1)
> lay <- cbind(lay[,2], lay[,1]) # rotate
> x11(width=15, height=8)
> plot(mst, layout=lay, vertex.size=5, vertex.size2=10,
> vertex.shape="circle", asp=FALSE,
> vertex.label.cex=0.7, vertex.color="green")
>
> ________________________________
> From: address@hidden
> To: address@hidden
> Date: Wed, 8 Aug 2012 16:58:51 +0000
> Subject: [igraph] Square Matrix /MST
>
> Hello Everyone,
> I'm rather new to igraph. I am using Windows 7 to create an MST
> (Minimum Spanning Tree) with the attached data file. However, I keep getting
> that this data is not a square matrix. Any kind of help will be much
> appreciated.
>
> Thank you,
> Jameson
>
> _______________________________________________ igraph-help mailing list
> address@hidden https://lists.nongnu.org/mailman/listinfo/igraph-help
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <address@hidden> MTA KFKI RMKI