ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 27 May 2016 04:27:22 +0200Graphics array formattinghttps://ask.sagemath.org/question/33562/graphics-array-formatting/ I'm computing a number of plots (actually collections of 2d polygons) of roughly square aspect ratio, and would like to display them in a reasonable way:
* use two columns
* preserve order
* title each of them
* adjust the size to fill the width of my notebook, disregarding the height
First I displayed each graphics as it arrived, or combined bunches of them into `graphics_array` in order to show them. But my sage notebook (the classical one, not the IPython flavor) failed to preserve order in that case. So I feel that I have to build one big `graphics_array`.
But I've got trouble adjusting its width without specifying its height, and I don't know a suitable height up front. Most of the times if I specify one of the sizes too large, I end up with lots of empty space in one of the directions.
Furthermore, I didn't manage to title the individual graphics, since a `title` attribute to the `polygon2d` call remains without effect, while a `title` attribute to the `show` affects the whole plot and all the nested plots. Constructing an empty `Graphics(title="foo")` doesn't seem to work.
This is on sage 6.10.beta4, so things might have improved since then. If so, I haven't yet found the appropriate locations in the online documentation indicating how this changed.
If you want to try this out: I wanted to format the output of [this code](https://gist.github.com/gagern/e9606b3f12d53ff92c4541e1e7b51d6d) but using two columns and a varying number of rows for each *n*.Fri, 27 May 2016 01:41:11 +0200https://ask.sagemath.org/question/33562/graphics-array-formatting/Comment by kcrisman for <p>I'm computing a number of plots (actually collections of 2d polygons) of roughly square aspect ratio, and would like to display them in a reasonable way:</p>
<ul>
<li>use two columns</li>
<li>preserve order</li>
<li>title each of them</li>
<li>adjust the size to fill the width of my notebook, disregarding the height</li>
</ul>
<p>First I displayed each graphics as it arrived, or combined bunches of them into <code>graphics_array</code> in order to show them. But my sage notebook (the classical one, not the IPython flavor) failed to preserve order in that case. So I feel that I have to build one big <code>graphics_array</code>.</p>
<p>But I've got trouble adjusting its width without specifying its height, and I don't know a suitable height up front. Most of the times if I specify one of the sizes too large, I end up with lots of empty space in one of the directions.</p>
<p>Furthermore, I didn't manage to title the individual graphics, since a <code>title</code> attribute to the <code>polygon2d</code> call remains without effect, while a <code>title</code> attribute to the <code>show</code> affects the whole plot and all the nested plots. Constructing an empty <code>Graphics(title="foo")</code> doesn't seem to work.</p>
<p>This is on sage 6.10.beta4, so things might have improved since then. If so, I haven't yet found the appropriate locations in the online documentation indicating how this changed.</p>
<p>If you want to try this out: I wanted to format the output of <a href="https://gist.github.com/gagern/e9606b3f12d53ff92c4541e1e7b51d6d">this code</a> but using two columns and a varying number of rows for each <em>n</em>.</p>
https://ask.sagemath.org/question/33562/graphics-array-formatting/?comment=33563#post-id-33563Related, though I don't think solving these necessarily solve your issue: http://trac.sagemath.org/ticket/10657, http://trac.sagemath.org/ticket/11160, http://trac.sagemath.org/ticket/10656Fri, 27 May 2016 04:27:22 +0200https://ask.sagemath.org/question/33562/graphics-array-formatting/?comment=33563#post-id-33563