- use
%pylab inline
or%pylab
to enable pylab mode. This will alter the event loop either to show plots inline (notebook) or to display them in different window without interfering the code execution (CLI).- Executing
%pylab
will set ipython to handle matplotlib nicely, and will also commitfrom pylab import *
that will put numpy and matplotlib commands inside your default namespace. - equivalent way to that, when you invoke IPython, use `ipython --pylab [notebook|qtconsole|etc..]. In windows, you can either do that from console or alter a shortcut to add command line arguments.
- You can change IPython system wide configuration to load pylab, see http://ipython.org/ipython-doc/stable/config/overview.html#flags
- Executing
See this answer for more information: https://stackoverflow.com/a/21457629/3245308