igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Plotting order of a network


From: Tamás Nepusz
Subject: Re: [igraph] Plotting order of a network
Date: Fri, 22 Feb 2013 10:30:56 +0100

Hi Jeff,

I don't know whether controlling the order in which nodes are drawn is actually 
possible in the R interface (maybe Gabor can answer that if he's around). It is 
true that nodes are drawn in order of their vertex IDs by default and lower IDs 
are drawn first. One thing that you can surely do is to permute the vertex IDs 
using the permute.vertices function such that the vertices you wish to be drawn 
on the top get higher IDs. E.g., suppose that you want to draw your vertices 
such that the ones with higher degrees appear on top:

> degrees <- degree(graph)
> g2 <- permute.vertices(g, rank(degrees, ties.method="first"))

Then you can plot g2 and the vertices with larger degrees will be drawn later.

-- 
T.

On 22 Feb 2013, at 00:44, Jeff Hemsley <address@hidden> wrote:

> I have a medium sized network (vcount~12000, ecount~15000) and plot
> it, is there a way to control when specific nodes and edges get
> plotted?
> 
> It appears that when I create
> 
> g <- graph.data.frame(my.network.edgelist.df, directed=TRUE)
> 
> the nodes-edges early in the df get printed first, and the nodes-edges
> later in the df get printed last.
> 
> Is there a way to reorder a network or specify the plotting order once
> a network has been created?
> 
> If not, I can create the network, do my analysis, spit out an edge
> list and rebuild a new network in whatever order I like, but this
> seems tedious...
> 
> 
> 
> -- 
> Jeff Hemsley
> Doctoral Candidate
> The Information School
> University of Washington
> http://staff.washington.edu/jhemsley/
> http://somelab.net/author/jhemsley/
> address@hidden
> 
> _______________________________________________
> 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]