##// END OF EJS Templates
Merge pull request #2179 from dopplershift/pylab-switch...
Merge pull request #2179 from dopplershift/pylab-switch Enable switching %pylab mode between inline and a single gui mode in a single notebook. With this merge, `%pylab` can be called interactively to toggle inline/GUI (matplotlib floating windows) mode. After initializing `%pylab inline`, now one can call `%pylab` without arguments to activate the default GUI or ask for a specific one as usual. IPython will detect if a different GUI is requested if one was already activated and will refuse to do so (to prevent multiple event loops from running concurrently, which often leads to problems).

File last commit:

r7943:d45b5792
r8027:6dac6929 merge
Show More
Pylab Switching.ipynb
107 lines | 8.3 KiB | text/plain | TextLexer
In [3]:
# Should pop up a GUI window
%pylab qt
plot([1,2,3])
Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].
For more information, type 'help(pylab)'.
Out[3]:
[<matplotlib.lines.Line2D at 0x4566850>]
In [4]:
# Should make an inline figure
%pylab inline
plot([1,2,3])
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.
Out[4]:
[<matplotlib.lines.Line2D at 0x4830ad0>]
No description has been provided for this image
In [11]:
# New GUI window--should *NOT* have the visual settings of inline
%pylab qt
plot([1,2,3])
Welcome to pylab, a matplotlib-based Python environment [backend: Qt4Agg].
For more information, type 'help(pylab)'.
Out[11]:
[<matplotlib.lines.Line2D at 0x5253850>]