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, 01 Jul 2018 02:05:01 +0200Drawing Auslander-Reiten quivers with sage possible?https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/Hi,
I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.
Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?
Any help would be appreciated.
Edit:
I used the following code:
sage: H=DiGraph()
sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])
sage: H.add_edges([(7,8),(7,9),(12,9)])
After having typed
sage: H.show()
a few times I got the following output:
![pic1](/upfiles/1479480509763302.png)
Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).Fri, 18 Nov 2016 14:49:43 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/Comment by slelievre for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35655#post-id-35655@Bern, maybe you can also say how you produce your Auslander-Reiten quiver? And how you use that quiver to choose the edges of your digraph.Fri, 18 Nov 2016 20:41:47 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35655#post-id-35655Comment by slelievre for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35639#post-id-35639Please provide the code you used in your attempts so far. It might be a good starting point for someone to help.Fri, 18 Nov 2016 14:54:01 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35639#post-id-35639Comment by Bern for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35644#post-id-35644Thank you very much for your comment. I edited the question.Fri, 18 Nov 2016 15:51:08 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35644#post-id-35644Comment by FrédéricC for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35653#post-id-35653Note that vertices of a graph can also be pairs (i,j), that could be very useful here.
You can also choose the positions of the vertices using a dictionary. Read the doc: DiGraph?Fri, 18 Nov 2016 19:33:51 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35653#post-id-35653Comment by fidbc for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35659#post-id-35659It seems like the edge_style attribute for graph plots applies to all edges of a graph.Sat, 19 Nov 2016 19:13:21 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35659#post-id-35659Comment by FrédéricC for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35699#post-id-35699I suggest to superimpose 2 graphs. By choosing the vertex positions yourself, this should be easy.Wed, 23 Nov 2016 09:06:47 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=35699#post-id-35699Answer by fidbc for <p>Hi,</p>
<p>I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph.</p>
<p>Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers?</p>
<p>Any help would be appreciated.</p>
<p>Edit:</p>
<p>I used the following code:</p>
<p>sage: H=DiGraph()</p>
<p>sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)])</p>
<p>sage: H.add_edges([(7,8),(7,9),(12,9)])</p>
<p>After having typed</p>
<p>sage: H.show()</p>
<p>a few times I got the following output:</p>
<p><img alt="pic1" src="/upfiles/1479480509763302.png"></p>
<p>Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2).</p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?answer=35706#post-id-35706Following the suggestion from @FrédéricC in the comments.
Here is a bit of code that might help.
def draw_quiver(E1,E2):
H = DiGraph(E1+E2)
H.layout('spring',save_pos=True)
H1=DiGraph(solid_edges)
P1=H1.plot(pos=H.get_pos())
H2=DiGraph(dashed_edges)
P2=H2.plot(pos=H.get_pos(),edge_colors={'red':dashed_edges},edge_style='--')
return P1+P2
Then the following code
solid_edges = [(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)]
dashed_edges = [(7,8),(7,9),(12,9)]
draw_quiver(solid_edges,dashed_edges).show(axes=False)
produces the png displayed below.
![image description](/upfiles/1479936988599586.png)Wed, 23 Nov 2016 22:37:22 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?answer=35706#post-id-35706Comment by Bern for <p>Following the suggestion from <a href="/users/1557/fredericc/">@FrédéricC</a> in the comments.</p>
<p>Here is a bit of code that might help.</p>
<pre><code>def draw_quiver(E1,E2):
H = DiGraph(E1+E2)
H.layout('spring',save_pos=True)
H1=DiGraph(solid_edges)
P1=H1.plot(pos=H.get_pos())
H2=DiGraph(dashed_edges)
P2=H2.plot(pos=H.get_pos(),edge_colors={'red':dashed_edges},edge_style='--')
return P1+P2
</code></pre>
<p>Then the following code</p>
<pre><code>solid_edges = [(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)]
dashed_edges = [(7,8),(7,9),(12,9)]
draw_quiver(solid_edges,dashed_edges).show(axes=False)
</code></pre>
<p>produces the png displayed below.</p>
<p><img alt="image description" src="/upfiles/1479936988599586.png"></p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=40713#post-id-40713Thank you very much for your answer (and sorry for my very late reply). It works perfectly fine! :-)Sat, 20 Jan 2018 15:18:22 +0100https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=40713#post-id-40713Comment by fidbc for <p>Following the suggestion from <a href="/users/1557/fredericc/">@FrédéricC</a> in the comments.</p>
<p>Here is a bit of code that might help.</p>
<pre><code>def draw_quiver(E1,E2):
H = DiGraph(E1+E2)
H.layout('spring',save_pos=True)
H1=DiGraph(solid_edges)
P1=H1.plot(pos=H.get_pos())
H2=DiGraph(dashed_edges)
P2=H2.plot(pos=H.get_pos(),edge_colors={'red':dashed_edges},edge_style='--')
return P1+P2
</code></pre>
<p>Then the following code</p>
<pre><code>solid_edges = [(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)]
dashed_edges = [(7,8),(7,9),(12,9)]
draw_quiver(solid_edges,dashed_edges).show(axes=False)
</code></pre>
<p>produces the png displayed below.</p>
<p><img alt="image description" src="/upfiles/1479936988599586.png"></p>
https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=42798#post-id-42798You are welcome :-)Sun, 01 Jul 2018 02:05:01 +0200https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/?comment=42798#post-id-42798