On Mon, Jun 2, 2008 at 7:28 AM, John Hunter <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 2, 2008 at 3:26 AM, Fernando Perez <[EMAIL PROTECTED]> wrote:
>
>> I've added this little bit of code to the default ipython -pylab startup:
>
> The latest releases of pylab already provide np and plt in the pylab 
> namespace.
>
> Would it be better to simply add a "pyplot" mode to ipython to
> encourage the proper usage, and in this mode import only as few
> symbols (np, plt, and sp if possible)?

I'm not sure the duplication is worthwhile (users don't read mailing
lists on weekends, you know?  They have lives and all that :)
Besides, for ipython the 'import *' mode *is* a reasonable use case,
since when you're working interactively, you really just want to type

plot(x,cos(x**2)+sin(x**3))

and not some plt.foo/np.bar contraption.  So I think there remains a
use case for importing all the names in at the top level (remember
that you can configure now ipython to NOT do 'from pylab import *'
anymore if you reall want a clean namespace).

The use case is mostly to provide an environment where the standard
examples and docstrings that may use either numpy or np,
pylab/pyplot/plt are always defined, so users can copy/paste without
fear.

Cheers,

f

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to