Ticket #5938 (closed defect: duplicate)
graph plotting -- ploting of graphs (networks) is somehow messed up/scaled wrong/cropped wrong since it doesn't work with graphics_array
| Reported by: | was | Owned by: | rlm |
|---|---|---|---|
| Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | graph theory | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Jason Grout |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description (last modified by jdemeyer) (diff)
Want to see some truly hideous plotting output? Try this:
Q = GraphQuery(display_cols=['graph6','num_vertices','degree_sequence'],num_edges=['<=',5],min_degree=1) v = Q.get_graphs_list(); v graphics_array([g.plot() for g in v], 3, len(v)//3).show()
I guess the problem is maybe Networkx drawing the plots instead of Sage (??), hence the cropping/layout is wrong? I don't know. Why do we use networkx at all for any part of plotting? It would be better to plot to native Sage primitives, wouldn't it?
Fixed by #9211.
Change History
comment:2 Changed 4 years ago by was
And even this results in bits being chopped off that shouldn't be!
for g in v[:5]:
show(g)
comment:3 Changed 4 years ago by ekirkman
I'm still working on this, but I have some updates. It looks like the first problem is the buffer size on scatter_plot. It's including the points, but not the vertex radius of the outermost points. That should be simple enough to fix, but then I'll also look at some auto-scaling to make the graphics_array a little nicer. I also feel like the graphs_list module had some nice parameters for graphics_arrays of graphs, but they might be outdated now that graph plotting is native in Sage. I'll check into that too though.
comment:5 Changed 3 years ago by was
- Report Upstream set to N/A
<vent> THIS SUCKS!!!!!!!!!!!
I can't believe how annoying it is that plotting graphs is still so totally and completely broken. It is really, really horrible. I don't know how anybody can stand this.
Frickin' a. Every single graph plot I try has the borders chopped off. E.g.,
sage: Q = GraphQuery(display_cols=['graph6','num_vertices','degree_sequence'], num_edges=['<=',5],min_degree=1) sage: Q.show(with_picture=True) [[hideous pain]]
comment:7 Changed 3 years ago by rlm
Warning- I've seen several "fixes" for this go in, and yet it's still borken
comment:9 Changed 17 months ago by jason
- Status changed from new to needs_review
Graph vertices are not cut off anymore. The plot in the description has overlapping vertices, though.
comment:10 Changed 17 months ago by jason
- Status changed from needs_review to positive_review
- Milestone changed from sage-4.8 to sage-duplicate/invalid/wontfix
This is a dup of #9211. Since the patch is there, and it is already merged, I'm calling this the duplicate.
comment:11 Changed 17 months ago by jdemeyer
- Status changed from positive_review to closed
- Reviewers set to Jason Grout
- Resolution set to duplicate
- Description modified (diff)

Even this (following the above example), results in hideous mis-cropped plots, and it doesn't use graphics array at all:
for g in v[:5]: show(g,figsize=2)