Ticket #11908 (closed defect: fixed)
Fix tree plotting again
|Reported by:||boothby||Owned by:||jason, ncohen, rlm|
|Component:||graph theory||Keywords:||tree, plot|
|Cc:||nthiery, vdelecroix, ncohen||Work issues:|
|Report Upstream:||N/A||Reviewers:||Nathann Cohen|
|Authors:||Frédéric Chapoton||Merged in:||sage-5.10.beta3|
Description (last modified by ncohen) (diff)
I wrote some code that produces fairly nice-looking tree plots in #6747, and, I might point out, worked great. For some reason, this was obliterated in #7004 with code that almost does the right thing, but fails to draw the tree crossing-free with high probability.
The easy thing is to add a parameter shuffle to GenericGraph.layout_ranked, so GenericGraph.layout_tree could just call return self.layout_ranked(heights_dict,shuffle=False) to avoid the (somewhat baffling) behavior of shuffling the vertices along the heights. IMHO, the default should be to not shuffle... but the primary focus of this ticket is to fix the damned tree plots. Again.
My preference is to bring back my code from #6747, since the results are pretty, and I find the "shrink-wrapped" look of layout_ranked to be incomprehensible for large-ish trees. A good compromise is to add options: layout = "tree", "tree:hang", "tree:shrinkwrap", "tree:circle", etc.
Note to reviewers: look at the plots produced in the doctests before giving a positive review.
- Status changed from new to needs_review
- Authors set to Frédéric Chapoton
comment:15 Changed 9 days ago by boothby
- Status changed from positive_review to needs_work