Show More
@@ -253,7 +253,7 b' def import_pylab(user_ns, import_all=True):' | |||||
253 | exec s in user_ns |
|
253 | exec s in user_ns | |
254 |
|
254 | |||
255 |
|
255 | |||
256 |
def configure_ |
|
256 | def configure_inline_backend(shell, user_ns=None): | |
257 | """Configure an IPython shell object for matplotlib use. |
|
257 | """Configure an IPython shell object for matplotlib use. | |
258 |
|
258 | |||
259 | Parameters |
|
259 | Parameters | |
@@ -280,7 +280,6 b' def configure_shell(shell, backend, user_ns=None):' | |||||
280 | if cfg not in shell.configurables: |
|
280 | if cfg not in shell.configurables: | |
281 | shell.configurables.append(cfg) |
|
281 | shell.configurables.append(cfg) | |
282 |
|
282 | |||
283 | if backend == backends['inline']: |
|
|||
284 |
|
|
283 | from IPython.zmq.pylab.backend_inline import flush_figures | |
285 |
|
|
284 | from matplotlib import pyplot | |
286 |
|
|
285 | shell.register_post_execute(flush_figures) | |
@@ -324,7 +323,11 b' def pylab_activate(user_ns, gui=None, import_all=True, shell=None):' | |||||
324 | gui, backend = find_gui_and_backend(gui) |
|
323 | gui, backend = find_gui_and_backend(gui) | |
325 | activate_matplotlib(backend) |
|
324 | activate_matplotlib(backend) | |
326 | import_pylab(user_ns, import_all) |
|
325 | import_pylab(user_ns, import_all) | |
327 | configure_shell(shell, backend, user_ns) |
|
326 | ||
|
327 | # The inline backend is only used by GUI shells | |||
|
328 | if backend == backends['inline']: | |||
|
329 | configure_inline_backend(shell, backend, user_ns) | |||
|
330 | ||||
328 | print """ |
|
331 | print """ | |
329 | Welcome to pylab, a matplotlib-based Python environment [backend: %s]. |
|
332 | Welcome to pylab, a matplotlib-based Python environment [backend: %s]. | |
330 | For more information, type 'help(pylab)'.""" % backend |
|
333 | For more information, type 'help(pylab)'.""" % backend |
General Comments 0
You need to be logged in to leave comments.
Login now