def enable_pylab(self, gui=None, import_all=True):
from IPython.core.pylabtools import mpl_runner<EOL>ns = {}<EOL>try:<EOL><INDENT>gui = pylab_activate(ns, gui, import_all, self)<EOL><DEDENT>except KeyError:<EOL><INDENT>error("<STR_LIT>" % gui)<EOL>return<EOL><DEDENT>self.user_ns.update(ns)<EOL>self.user_ns_hidden.update(ns)<EOL>self.enable_gui(gui)<EOL>self.magics_manager.registry['<STR_LIT>'].default_runner =mpl_runner(self.safe_execfile)<EOL>
Activate pylab support at runtime.

        This turns on support for matplotlib, preloads into the interactive
        namespace all of numpy and pylab, and configures IPython to correctly
        interact with the GUI event loop.  The GUI backend to be used can be
        optionally selected with the optional :param:`gui` argument.

        Parameters
        ----------
        gui : optional, string

          If given, dictates the choice of matplotlib GUI backend to use
          (should be one of IPython's supported backends, 'qt', 'osx', 'tk',
          'gtk', 'wx' or 'inline'), otherwise we use the default chosen by
          matplotlib (as dictated by the matplotlib build-time options plus the
          user's matplotlibrc configuration file).  Note that not all backends
          make sense in all contexts, for example a terminal ipython can't
          display figures inline.