##// END OF EJS Templates
fix circular matplotlib imports on ipykernel 4.4 + python 2...
Min RK -
Show More
@@ -199,7 +199,6 b' def select_figure_formats(shell, formats, **kwargs):'
199 199 """
200 200 import matplotlib
201 201 from matplotlib.figure import Figure
202 from ipykernel.pylab import backend_inline
203 202
204 203 svg_formatter = shell.display_formatter.formatters['image/svg+xml']
205 204 png_formatter = shell.display_formatter.formatters['image/png']
@@ -358,7 +357,7 b' def configure_inline_support(shell, backend):'
358 357 from ipykernel.pylab.backend_inline import InlineBackend
359 358 except ImportError:
360 359 return
361 from matplotlib import pyplot
360 import matplotlib
362 361
363 362 cfg = InlineBackend.instance(parent=shell)
364 363 cfg.shell = shell
@@ -372,9 +371,9 b' def configure_inline_support(shell, backend):'
372 371 # Save rcParams that will be overwrittern
373 372 shell._saved_rcParams = dict()
374 373 for k in cfg.rc:
375 shell._saved_rcParams[k] = pyplot.rcParams[k]
374 shell._saved_rcParams[k] = matplotlib.rcParams[k]
376 375 # load inline_rc
377 pyplot.rcParams.update(cfg.rc)
376 matplotlib.rcParams.update(cfg.rc)
378 377 new_backend_name = "inline"
379 378 else:
380 379 from ipykernel.pylab.backend_inline import flush_figures
@@ -383,7 +382,7 b' def configure_inline_support(shell, backend):'
383 382 except ValueError:
384 383 pass
385 384 if hasattr(shell, '_saved_rcParams'):
386 pyplot.rcParams.update(shell._saved_rcParams)
385 matplotlib.rcParams.update(shell._saved_rcParams)
387 386 del shell._saved_rcParams
388 387 new_backend_name = "other"
389 388
General Comments 0
You need to be logged in to leave comments. Login now