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.Sun, 15 Oct 2017 21:11:27 +0200Edge color for undirected multiedge graphshttps://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/ It seems that there is a bug with specifying the color of undirected multiedges. Here's an example:
G=graphs.PathGraph(2)
G.allow_multiple_edges(True)
G.add_edge((0,1))
G.plot(edge_colors={"red":[(1,0)]})
The graph plotted has then four edges, two black and two red. It seems that the multiedge to be colored red is seen as a different one than the already present one, even though they are actually the same since the graph is undirected. I get the intended plot if I change the last line to:
G.plot(edge_colors={"red":[(0,1)]})Fri, 13 Oct 2017 16:00:23 +0200https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/Comment by slelievre for <p>It seems that there is a bug with specifying the color of undirected multiedges. Here's an example:</p>
<pre><code>G=graphs.PathGraph(2)
G.allow_multiple_edges(True)
G.add_edge((0,1))
G.plot(edge_colors={"red":[(1,0)]})
</code></pre>
<p>The graph plotted has then four edges, two black and two red. It seems that the multiedge to be colored red is seen as a different one than the already present one, even though they are actually the same since the graph is undirected. I get the intended plot if I change the last line to:</p>
<pre><code>G.plot(edge_colors={"red":[(0,1)]})
</code></pre>
https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?comment=39180#post-id-39180Thank you for spotting this bug and reporting it. Thanks to David Coudert, this should be fixed in Sage 8.1 when it comes out.Sun, 15 Oct 2017 21:11:27 +0200https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?comment=39180#post-id-39180Answer by David Coudert for <p>It seems that there is a bug with specifying the color of undirected multiedges. Here's an example:</p>
<pre><code>G=graphs.PathGraph(2)
G.allow_multiple_edges(True)
G.add_edge((0,1))
G.plot(edge_colors={"red":[(1,0)]})
</code></pre>
<p>The graph plotted has then four edges, two black and two red. It seems that the multiedge to be colored red is seen as a different one than the already present one, even though they are actually the same since the graph is undirected. I get the intended plot if I change the last line to:</p>
<pre><code>G.plot(edge_colors={"red":[(0,1)]})
</code></pre>
https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?answer=39171#post-id-39171This is now ticket [#24051](https://trac.sagemath.org/ticket/24051)Sun, 15 Oct 2017 16:07:22 +0200https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?answer=39171#post-id-39171Comment by slelievre for <p>This is now ticket <a href="https://trac.sagemath.org/ticket/24051">#24051</a></p>
https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?comment=39179#post-id-39179Thank you for opening the ticket and providing a fix!Sun, 15 Oct 2017 21:10:23 +0200https://ask.sagemath.org/question/39153/edge-color-for-undirected-multiedge-graphs/?comment=39179#post-id-39179