[IPython-dev] Notebook: Horizontal layout for multiple figures in output cell
Fri Feb 21 13:54:50 CST 2014
Looking at the HTML structure I found that the output cell is inside a <div
class="output_vbox"> containing one or more <div class="output_area"> that
are vertically stacked. With two plots we have 3 "output_area": the first
for the text output (Out ...) and the other two for the two figures.
The problem in changing the style of <div class="output_vbox"> to
horizontal is that also the text-only div will be stacked horizontally,
shifting the figures to the right. Probably this is why Jon had right
Ideally the output text should stay unchanged and the figures stacked
horizontally just below the text, with a left alignment.
Any idea on how to achieve this appreciated.
On Fri, Feb 21, 2014 at 10:49 AM, Jon Wilson <email@example.com> wrote:
> I often have the same desire as Antonino, for much the same reasons.
> Creating subplots is really not an appropriate solution. The separate
> figures are exactly that, separate figures. It is semantically incorrect
> to combine them into one figure, and causes additional complications when I
> want to save them to a file (for example if I want to include them in a
> manuscript) -- if I have combined them as subplots, then when I want to
> save them, I must re-separate them.
> Antonino, at one point, with a much older (pre 1.0) version of the
> notebook, I found a way to hack the notebook CSS so that output cells would
> float left. This was a (nearly) perfect solution for me. However, I
> suspect it might not work anymore with newer versions of the notebook.
> When I updated to a post 1.0 version, I never took the time to get it
> working again. But perhaps that idea is a starting point for you. Take a
> look at the HTML structure of the notebook and output cells, and then
> fiddle with the CSS (in whatever way is now appropriate) until you get
> something that works better for you.
> On 02/21/2014 12:13 PM, Patrick Surry wrote:
> If you're using matplotlib for your plots, you can use subplots to
> create a horizontal (or arbitrary grid) of plots in an output cell.
> Try this example
> but change plt.subplot(2,1,1) and plt.subplot(2,1,2) (which indicate a
> 2x1 grid and plot #1 and #2) to plt.subplot(1,2,1) and plt.subplot(1,2,2)
> which does the same in a 1x2 grid.
> IPython-dev mailing listIPythonfirstname.lastname@example.org://mail.scipy.org/mailman/listinfo/ipython-dev
> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev