ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 28 Feb 2015 11:42:09 +0100Is there other ways to visualize weights of the graph edges aside from labels?https://ask.sagemath.org/question/25965/is-there-other-ways-to-visualize-weights-of-the-graph-edges-aside-from-labels/Assuming I have graph:
M = Matrix([[0,1,-1],[1,0,-1/2],[-1,-1/2,0]])
G = Graph(M)
In order to plot it and visualize edge weights I can do:
G.plot(edge_labels=True)
This will put labels on the edges, but is there other ways? For example, varying edge thickness in regard to the weight it represents, so the higher weight will be represented by thick lines and lower by thin lines? Or, more generally, is there other ways of visualization of the weights?Sat, 28 Feb 2015 10:56:36 +0100https://ask.sagemath.org/question/25965/is-there-other-ways-to-visualize-weights-of-the-graph-edges-aside-from-labels/Answer by Nathann for <p>Assuming I have graph:</p>
<pre><code>M = Matrix([[0,1,-1],[1,0,-1/2],[-1,-1/2,0]])
G = Graph(M)
</code></pre>
<p>In order to plot it and visualize edge weights I can do:</p>
<pre><code>G.plot(edge_labels=True)
</code></pre>
<p>This will put labels on the edges, but is there other ways? For example, varying edge thickness in regard to the weight it represents, so the higher weight will be represented by thick lines and lower by thin lines? Or, more generally, is there other ways of visualization of the weights?</p>
https://ask.sagemath.org/question/25965/is-there-other-ways-to-visualize-weights-of-the-graph-edges-aside-from-labels/?answer=25966#post-id-25966No, I do not think that there is. If you do not have many weights you can adapt the color of each edge individually I guess (use the edge_colors argument). This software, however, is open-source, so you can add whatever you miss.
http://www.sagemath.org/doc/reference/plotting/sage/graphs/graph_plot.html
Nathann
Sat, 28 Feb 2015 11:42:09 +0100https://ask.sagemath.org/question/25965/is-there-other-ways-to-visualize-weights-of-the-graph-edges-aside-from-labels/?answer=25966#post-id-25966