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.Tue, 08 Apr 2014 02:22:55 +0200Graph coloring and sagetexhttps://ask.sagemath.org/question/11350/graph-coloring-and-sagetex/If I type this code into a Sage Cell Server, I get a coloring of graph:
from sage.graphs.graph_coloring import vertex_coloring
g = graphs.Grid2dGraph(3,3)
p = g.coloring()
g.show(dist=1,vertex_size=250, graph_border=False, figsize=[15,15],partition=p)
I want to get a nice looking version into a LaTeX document using sagetex. When I type this inside a sagesilent block:
from sage.graphs.graph_coloring import vertex_coloring
g = graphs.Grid2dGraph(3,3)
p = g.coloring()
g.set_latex_options(graphic_size=(5,5), tkz_style = 'Custom',vertex_size = 0.2, edge_thickness = 0.04, edge_color = 'black',vertex_labels=False)
and then call: \sage{g}
outside of the sagesilent block, the graph is no longer colored. I tried lots of variations, such as \sage{g.show(partitions=True)} but with no success.
What's the correct way to get the graph coloring to show up in the LaTeX document?dazedANDconfusedTue, 08 Apr 2014 02:22:55 +0200https://ask.sagemath.org/question/11350/SageTex 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 :)
TyHolosmosTue, 27 Aug 2013 12:27:20 +0200https://ask.sagemath.org/question/10474/