Show More
@@ -253,7 +253,7 b' def import_pylab(user_ns, import_all=True):' | |||
|
253 | 253 | exec s in user_ns |
|
254 | 254 | |
|
255 | 255 | |
|
256 |
def configure_ |
|
|
256 | def configure_inline_backend(shell, user_ns=None): | |
|
257 | 257 | """Configure an IPython shell object for matplotlib use. |
|
258 | 258 | |
|
259 | 259 | Parameters |
@@ -280,14 +280,13 b' def configure_shell(shell, backend, user_ns=None):' | |||
|
280 | 280 | if cfg not in shell.configurables: |
|
281 | 281 | shell.configurables.append(cfg) |
|
282 | 282 | |
|
283 | if backend == backends['inline']: | |
|
284 | from IPython.zmq.pylab.backend_inline import flush_figures | |
|
285 | from matplotlib import pyplot | |
|
286 | shell.register_post_execute(flush_figures) | |
|
287 | # load inline_rc | |
|
288 | pyplot.rcParams.update(cfg.rc) | |
|
289 | # Add 'figsize' to pyplot and to the user's namespace | |
|
290 | user_ns['figsize'] = pyplot.figsize = figsize | |
|
283 | from IPython.zmq.pylab.backend_inline import flush_figures | |
|
284 | from matplotlib import pyplot | |
|
285 | shell.register_post_execute(flush_figures) | |
|
286 | # load inline_rc | |
|
287 | pyplot.rcParams.update(cfg.rc) | |
|
288 | # Add 'figsize' to pyplot and to the user's namespace | |
|
289 | user_ns['figsize'] = pyplot.figsize = figsize | |
|
291 | 290 | |
|
292 | 291 | # Setup the default figure format |
|
293 | 292 | fmt = cfg.figure_format |
@@ -324,7 +323,11 b' def pylab_activate(user_ns, gui=None, import_all=True, shell=None):' | |||
|
324 | 323 | gui, backend = find_gui_and_backend(gui) |
|
325 | 324 | activate_matplotlib(backend) |
|
326 | 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 | 331 | print """ |
|
329 | 332 | Welcome to pylab, a matplotlib-based Python environment [backend: %s]. |
|
330 | 333 | For more information, type 'help(pylab)'.""" % backend |
General Comments 0
You need to be logged in to leave comments.
Login now