Ask Your Question
1

Display graph drawings in order

asked 2018-08-17 20:53:35 +0100

lgmol gravatar image

updated 2018-08-17 22:34:02 +0100

Often I want to compute a graph parameter for each graph in a list of graphs. I would like to print the value of the chosen parameter along with a drawing of each graph. So I do something like this, where L is a list of graphs:

for G in L: print G.vertex_connectivity(); show(G.plot());

The problem is that the plots don't show up until after all of the printed output, and they appear in an order different from the original list. Is there any way to force a plot to appear exactly where I want it? I am using a Sage notebook.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-08-17 22:36:19 +0100

tmonteil gravatar image

updated 2018-08-17 22:41:45 +0100

Your code works prefectly well in the jupyter notebook. Which interface are you using ? EDIT If you are using he Sage notebook (which indeed first puts all the numbers ant then shows all the graphs), let me suggest to switch to the jupyter notebook since the Sage notebook is going to be deprecated and it is very unlikely that someone will ever work on that issue.

Alternatively, you can join your pictures the way you want within a graphics_array(put the text as a legend of each plot), see http://doc.sagemath.org/html/en/refer...

edit flag offensive delete link more

Comments

Thanks! I did not know about the Jupyter notebook, and as you say it works perfectly.

lgmol gravatar imagelgmol ( 2018-08-17 22:50:49 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-08-17 20:53:35 +0100

Seen: 298 times

Last updated: Aug 17 '18