[IPython-dev] --pylab flag deprecated

Fernando Perez fperez.net@gmail....
Wed Mar 5 09:07:42 CST 2014

Hi Vasco,

the recommended approach, that will make in the long run your notebooks
more readable, is to use

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

atop your notebooks. That will make it easier to know what comes from
where.  Now, if you *really* want to have a lot of top-level plotting and
numerical functions, and are willing to pay the price that for example
doing a lot of automatic imports clobbers the built-in python sum()
function with numpy.sum() (which can cause some surprises), you can still do

%pylab inline

at the top.  We will probably never remove this, partly because it's still
useful for *quick and dirty* analysis where you just want to do something
fast with minimal overhead, and is mostly throw-away scratch work.  This
kind of typing economy is also still very useful at the console.

But in the long run, our experience is that notebooks tend to linger for a
long time: in that scenario, it's worth paying the price of slightly more
verbose code with explicit imports, in order to reap the benefits of
readability in the long run.



On Wed, Mar 5, 2014 at 4:05 AM, Vasco Tenner <vasco+python@tenner.nl> wrote:

> Hi,
> I used to start ipython notebook with the --pylab flag, so I have all
> kinds of usefull functions directly available. By guessing and
> tab-completion many usefull functions, for data analysis popped up.
> (like plot, display etc).
> Now the --pylab flag will deprecate soon, what is the best alternative
> for an interactive environment. I already found it usefull to import
> from pylab:
> from pylab import *
> However, the --pylab flag did more: it also loaded a bunch of ipython
> functions, like IPython.display.display.
> Is there a preffered way to load this? To configure this in some
> enviroment?
> I just found the
> %pylab
> magic. Should I put this in the top cell of all my notebooks? What
> should I advice to my starting collegues?
> Groet,
> Vasco
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20140305/8a2caa4f/attachment.html 

More information about the IPython-dev mailing list