#7004: Refactor the graph layout code, and add interface with graphviz
---------------------------------+------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.3.3
Component: graph theory | Keywords: graph layout, graphviz, acyclic
Author: Nicolas M. ThiƩry | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------------+------------------------------------------
Comment(by rlm):
I tried reproducing this:
{{{
G = posets.IntegerPartitions(3).hasse_diagram()
G.plot(layout="acyclic_dummy", spring = True)
}}}
But I got:
{{{
AttributeError Traceback (most recent call
last)
/Users/rlmill/sage-4.3.2/devel/sage-main/<ipython console> in <module>()
/Users/rlmill/sage-4.3.2/local/lib/python2.6/site-
packages/sage/plot/misc.pyc in wrapper(*args, **kwds)
136 options['__original_opts'] = kwds
137 options.update(kwds)
--> 138 return func(*args, **options)
139
140
/Users/rlmill/sage-4.3.2/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.pyc in plot(self, **options)
9137 """
9138 from sage.graphs.graph_plot import GraphPlot
-> 9139 return GraphPlot(graph=self, options=options).plot()
9140
9141 def show(self, **kwds):
/Users/rlmill/sage-4.3.2/local/lib/python2.6/site-
packages/sage/graphs/graph_plot.pyc in __init__(self, graph, options)
83 self._graph = graph
84 self._options = options
---> 85 self.set_pos()
86 self._arcs =
self._graph.has_multiple_edges(to_undirected=True)
87 self._loops = self._graph.has_loops()
/Users/rlmill/sage-4.3.2/local/lib/python2.6/site-
packages/sage/graphs/graph_plot.pyc in set_pos(self)
183 self._pos = pos
184
--> 185 if not self._pos:
186 self._pos =
generic_graph_pyx.spring_layout_fast(self._graph,
iterations=self._options['iterations'], height=(self._options['heights']
is not None))
187
AttributeError: 'GraphPlot' object has no attribute '_pos'
}}}
Looks like the first if of `set_pos` needs an `else` clause. But this
wasn't the problem you indicated.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7004#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.