# .plot() displaying cycle graphs as huge pretzels

That big morass of vertices on the left is actually just a single cycle. Is there any way to get Sage to render it more sensibly? I'd use layout=planar but as you can see this isn't a simple graph, the 0 vertex is connected to itself.

I suspect this might just be Sage trying to fit the large cycle into a small space, is there some way to tell it what size image to use?

edit retag close merge delete

Sort by ยป oldest newest most voted

I don't agree with your very offensive criticism about pretzels.

This being said, and if you have no taste for food, you can give this a try :

sage: # Displays a Pretzel
sage: digraphs.Circuit(100).show()
sage: # Displays a calamari
sage: digraphs.Circuit(100).show(iterations=20000)


Now that I think of it, given the choice I would also chose a calamari over a pretzel.

Hence it all makes sense, after all.

Nathann

more

Thanks. Are there any guidelines on a reasonable amount of iterations to use, as a function of the number of vertices? I'm just going with vertices*2000, but it seems like this is excessive for smaller numbers of vertices - Circuit(5) does well with just 50 iterations.

( 2013-07-05 12:00:18 +0200 )edit

That said, now the vertices get grouped so close together I can't see the arcs - any way to make them longer, or increase the size of the "canvas"?

( 2013-07-05 12:10:29 +0200 )edit

No guidelines, just try what works for you as it will also depend on your graphs. And your plots seems to be very different from mine. It looks like you produce them with "view" instead of "plot", or that they are latex-produced. Anyway you can play with the (many) options or .plot() and .show() to change the size of labels. It's all very "custom", but if you find good ways to tune those options you are very welcome to patch Sage with it !

( 2013-07-07 17:11:14 +0200 )edit

Small edit : I uploaded a pach there (http://trac.sagemath.org/ticket/14953) which lets one draw graphs in javascripts. As you can then move the vertices around, you'll be saved from pretzels.

( 2013-08-02 06:52:10 +0200 )edit