Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph plotting -- ploting of graphs (networks) is somehow messed up/scaled wrong/cropped wrong since it doesn't work with graphics_array #5938

Closed
williamstein opened this issue Apr 29, 2009 · 12 comments

Comments

@williamstein
Copy link
Contributor

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.

Component: graph theory

Reviewer: Jason Grout

Issue created by migration from https://trac.sagemath.org/ticket/5938

@williamstein
Copy link
Contributor Author

comment:1

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)

@williamstein
Copy link
Contributor Author

comment:2

And even this results in bits being chopped off that shouldn't be!

for g in v[:5]:
    show(g)

@sagetrac-ekirkman
Copy link
Mannequin

sagetrac-ekirkman mannequin commented May 18, 2009

comment:3

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.

@jasongrout
Copy link
Member

@williamstein
Copy link
Contributor Author

comment:5
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]]

@rlmill
Copy link
Mannequin

rlmill mannequin commented Aug 10, 2010

comment:6

Fix it!

@rlmill
Copy link
Mannequin

rlmill mannequin commented Aug 10, 2010

comment:7

Warning- I've seen several "fixes" for this go in, and yet it's still borken

@jasongrout
Copy link
Member

comment:8

See #9211 for progress towards a fix.

@jasongrout
Copy link
Member

comment:9

Graph vertices are not cut off anymore. The plot in the description has overlapping vertices, though.

@jasongrout
Copy link
Member

comment:10

This is a dup of #9211. Since the patch is there, and it is already merged, I'm calling this the duplicate.

@jasongrout jasongrout removed this from the sage-4.8 milestone Dec 21, 2011
@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Jan 5, 2012

Reviewer: Jason Grout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants