#2378: graph and digraph animations
--------------------------+-------------------------------------------------
Reporter: jason | Owner: jason
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: graph theory | Resolution:
Keywords: |
--------------------------+-------------------------------------------------
Comment (by jason):
Code for a highlight function:
{{{
normal_vertex_color='#fec7b8'
normal_edge_color = 'black'
def highlight(g,vertices=[],edges=[],**kwds):
edges = [e[0:2] for e in edges]
normal_edges = list(set(g.edges(labels=False)).difference(set([e[0:2]
for e in edges])))
normal_vertices = list(set(g.vertices()).difference(set(vertices)))
return g.plot(vertex_colors={'red': vertices, normal_vertex_color:
normal_vertices}, edge_colors={'red': edges, normal_edge_color:
normal_edges},**kwds)
g=graphs.DodecahedralGraph()
highlight(g,[1,2],[(1,2),(2,6)],layout="spring")
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2378#comment:7>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---