ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 06 Jul 2013 15:13:28 -0500Labeling in graphshttp://ask.sagemath.org/question/10326/labeling-in-graphs/I am new to SAGE and am trying to experiment with it. What I am trying to do is something like this -
k = 1
G.add_edge((1,2), label= 'k')
Then it should label the edge as '1', not as 'k'. How would I do this?Sat, 06 Jul 2013 09:02:35 -0500http://ask.sagemath.org/question/10326/labeling-in-graphs/Answer by calc314 for <p>I am new to SAGE and am trying to experiment with it. What I am trying to do is something like this - </p>
<p>k = 1</p>
<p>G.add_edge((1,2), label= 'k')</p>
<p>Then it should label the edge as '1', not as 'k'. How would I do this?</p>
http://ask.sagemath.org/question/10326/labeling-in-graphs/?answer=15201#post-id-15201Try label=str(k).
Sat, 06 Jul 2013 09:53:54 -0500http://ask.sagemath.org/question/10326/labeling-in-graphs/?answer=15201#post-id-15201Comment by sanjith for <p>Try label=str(k).</p>
http://ask.sagemath.org/question/10326/labeling-in-graphs/?comment=17345#post-id-17345Thank you, it works. Sat, 06 Jul 2013 09:55:18 -0500http://ask.sagemath.org/question/10326/labeling-in-graphs/?comment=17345#post-id-17345Comment by kcrisman for <p>Try label=str(k).</p>
http://ask.sagemath.org/question/10326/labeling-in-graphs/?comment=17343#post-id-17343@sanjith - if the answer works, please do click the acceptance check mark :)Sat, 06 Jul 2013 15:13:28 -0500http://ask.sagemath.org/question/10326/labeling-in-graphs/?comment=17343#post-id-17343