diff --git a/IPython/Shell.py b/IPython/Shell.py index 69d2062..89ea90b 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -566,8 +566,18 @@ class MatplotlibShellBase: # Build a user namespace initialized with matplotlib/matlab features. user_ns = IPython.ipapi.make_user_ns(user_ns) - exec ("import matplotlib\n" - "import matplotlib.pylab as pylab\n") in user_ns + # Import numpy as np/pyplot as plt are conventions we're trying to + # somewhat standardize on. Making them available to users by default + # will greatly help this. + exec ("import numpy\n" + "import numpy as np\n" + "import matplotlib\n" + "import matplotlib.pylab as pylab\n" + "try:\n" + " import matplotlib.pyplot as plt\n" + "except ImportError:\n" + " pass\n" + ) in user_ns # Build matplotlib info banner b=""" diff --git a/doc/ChangeLog b/doc/ChangeLog index 6a17f31..30cd417 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2008-06-02 Fernando Perez + + * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): add + numpy/np/pyplot/plt imports according to new conventions we're + trying to standardize on. This only affects the -pylab mode. + 2008-05-31 *** Released version 0.8.4 2008-05-31 Fernando Perez