misterE
misterE

Reputation: 93

Graph using Sage

 G = DiGraph(A, format='weighted_adjacency_matrix')
 G.relabel([1..10],inplace=True)

 H = G.plot(edge_labels=False, graph_border=True)
 H.show()

Would it be possible to highlight a certain route through this graph? i.e make some lines a different colour, say, red?

Upvotes: 1

Views: 77

Answers (1)

Nathann Cohen
Nathann Cohen

Reputation: 302

Is this what you are looking for ?

sage: g = graphs.PetersenGraph()
sage: g.show(edge_colors={'red':[(0,1),(1,6),(6,9),(9,4)] })

The documentation of all available options for graph plots can be found on this page:

http://www.sagemath.org/doc/reference/plotting/sage/graphs/graph_plot.html

Nathann

Upvotes: 2

Related Questions