[IPython-dev] Notebook: Horizontal layout for multiple figures in output cell

Antonino Ingargiola tritemio at gmail.com
Fri Feb 21 13:41:03 EST 2014


Hi Patrick,

thanks for your input.

Yes I'm using matplotlib.

I know very well the different (and excellent!) options for creating
subplots.

In my workflow, as common in scientific computing, the analysis is
"evolving". I need to try several routes before I find the right way. So I
want to make this process as smooth as possible.

In this use case I value simplicity over everything else. For example when
I plot a series of plots I need to scale the subplots if the number of
plots changes (otherwise the plots becomes smaller, labels overlaps an so
on). Moreover with separate figures I'm "ready" to save "the good one" with
a savefig. Also, oftentimes I send my notebooks to non-python developers
(read PI), and if I use the most basic matlab-like interface they can
follow the code. When I start to mess with lists of axes, dynamic resizes,
etc.., the code become more difficult to follow, for no good reason. As I
said, using multiple figures is just too convenient in some use-cases.
 It's just annoying, in my case, that the figures stack vertically, and I
would like the option to change this.

I think this may be a common enough scenario to grant an IPython
config/option/plugin to achieve it.

Any suggestion is welcome...

Thanks,
Antonio




On Fri, Feb 21, 2014 at 10:13 AM, Patrick Surry <patrick.surry at gmail.com>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
> http://matplotlib.org/examples/pylab_examples/subplot_demo.html
>
> 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.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140221/fa16a0ea/attachment.html>


More information about the IPython-dev mailing list