ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 17 Aug 2018 15:50:49 -0500Display graph drawings in orderhttp://ask.sagemath.org/question/43403/display-graph-drawings-in-order/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.Fri, 17 Aug 2018 13:53:35 -0500http://ask.sagemath.org/question/43403/display-graph-drawings-in-order/Answer by tmonteil for <p>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:</p>
<p>for G in L:
print G.vertex_connectivity();
show(G.plot());</p>
<p>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.</p>
http://ask.sagemath.org/question/43403/display-graph-drawings-in-order/?answer=43404#post-id-43404Your 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/reference/plotting/sage/plot/plot.html#sage.plot.plot.graphics_arrayFri, 17 Aug 2018 15:36:19 -0500http://ask.sagemath.org/question/43403/display-graph-drawings-in-order/?answer=43404#post-id-43404Comment by lgmol for <p>Your code works prefectly well in the jupyter notebook. Which interface are you using ? <em>EDIT</em> 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.</p>
<p>Alternatively, you can join your pictures the way you want within a <code>graphics_array</code>(put the text as a legend of each plot), see <a href="http://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html#sage.plot.plot.graphics_array">http://doc.sagemath.org/html/en/refer...</a></p>
http://ask.sagemath.org/question/43403/display-graph-drawings-in-order/?comment=43405#post-id-43405Thanks! I did not know about the Jupyter notebook, and as you say it works perfectly.Fri, 17 Aug 2018 15:50:49 -0500http://ask.sagemath.org/question/43403/display-graph-drawings-in-order/?comment=43405#post-id-43405