> I would like to color the shortest path differently than the rest of my > network. I scoured the documentation and found no way to select individual > edges. Changing the attributes of all edges and vertices is well > documented. There's a code snippet on-line for R > E(g, path=pa)$color <- 'red' > > which doesn't seem to translate to python. Changing the attribute of an individual edge is done by indexing g.es first and then using the standard dict-like syntax to set the attribute; e.g.:
g.es[2]["color"] = "red" It also works with multiple edges: edges = 2, 3, 4 g.es[edges]["color"] = "red" If you have a path with the vertex IDs, you can get the corresponding edge IDs with: vertices = [2, 3, 4, 42] edges = g.get_eids(path=vertices) g.es[edges]["color"] = "red" All the best, -- T. _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
