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.Wed, 28 Aug 2013 10:52:38 +0200SageTex and graphshttps://ask.sagemath.org/question/10474/sagetex-and-graphs/Hey guys,
Today i was looking for some graph plotting and i didn't arrived to use that piece of code in my .tex :
from sage.graphs.graph_coloring import edge_coloring
g = graphs.CompleteGraph(10)
g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()
I can insert the first part in a block, but to plot I don't have the answer.
I tried : \sageplot{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()} and \sage{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True))} but nothing works :/
Of course \sage{g} works but i'd like to have the graphical options !
Help plz :)
TyTue, 27 Aug 2013 12:27:20 +0200https://ask.sagemath.org/question/10474/sagetex-and-graphs/Answer by Holosmos for <p>Hey guys,
Today i was looking for some graph plotting and i didn't arrived to use that piece of code in my .tex :</p>
<pre><code>from sage.graphs.graph_coloring import edge_coloring
g = graphs.CompleteGraph(10)
g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()
</code></pre>
<p>I can insert the first part in a block, but to plot I don't have the answer.
I tried : \sageplot{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()} and \sage{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True))} but nothing works :/</p>
<p>Of course \sage{g} works but i'd like to have the graphical options !</p>
<p>Help plz :)</p>
<p>Ty</p>
https://ask.sagemath.org/question/10474/sagetex-and-graphs/?answer=15388#post-id-15388It works
Thank you !Wed, 28 Aug 2013 10:52:38 +0200https://ask.sagemath.org/question/10474/sagetex-and-graphs/?answer=15388#post-id-15388Answer by Luca for <p>Hey guys,
Today i was looking for some graph plotting and i didn't arrived to use that piece of code in my .tex :</p>
<pre><code>from sage.graphs.graph_coloring import edge_coloring
g = graphs.CompleteGraph(10)
g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()
</code></pre>
<p>I can insert the first part in a block, but to plot I don't have the answer.
I tried : \sageplot{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()} and \sage{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True))} but nothing works :/</p>
<p>Of course \sage{g} works but i'd like to have the graphical options !</p>
<p>Help plz :)</p>
<p>Ty</p>
https://ask.sagemath.org/question/10474/sagetex-and-graphs/?answer=15387#post-id-15387This seems to be a bug in pdf exports. It has been reported as ticket <http://trac.sagemath.org/ticket/15116>.
As a temporary fix, you can
\begin{sageblock}
from sage.graphs.graph_coloring import edge_coloring
g = graphs.CompleteGraph(10)
p = g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()
p.save('graph.eps')
\end{sageblock}
\includegraphics{graph.eps}
Note that LaTeX will complain it cannot find `graph.eps` on first compilation, just ignore the error.
Wed, 28 Aug 2013 09:59:26 +0200https://ask.sagemath.org/question/10474/sagetex-and-graphs/?answer=15387#post-id-15387