Hi Jan,
> I have different datasets- the smallest networks consist of 80 nodes, the
> largest even 10,000 (yes I have a lot of RAM), but I'm happy to only
> visualise the small ones. At the moment I've got a numpy matrix, but I can
> convert it into a list of lists or anything else that is needed.
> [...] And additionally I have a list (or numpy array) with node labels, and
> another list with binary values which I would like to use to specify the node
> colour.
Then it is probably as simple as:
import igraph
import numpy
# ...create your NumPy matrix in m...
# if you want to keep only edges with a weight above a certain cutoff:
m[m < cutoff] = 0.0
# create the graph
g = igraph.Graph.Weighted_Adjacency(m)
# construct a layout
layout = g.layout_fruchterman_reingold(weights=g.es["weight"])
# construct the plot settings
plot_settings = dict(
layout=layout,
edge_width=igraph.rescale(g.es["weight"], out_range=(0.0, 5.0)),
vertex_label=any_list_of_strings,
vertex_color=["red" if value else "blue" for value in
any_list_of_booleans]
)
# plot the graph
plot(g, **plot_settings)
See the documentation of Graph.Weighted_Adjacency(),
Graph.layout_fruchterman_reingold(), Graph.__plot__() and rescale() for more
information.
All the best,
Tamas
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help