##// END OF EJS Templates
Change matplotlib.pyplot import syntax (for circular import bug)
Ben Lewis -
Show More
@@ -310,12 +310,12 b' def activate_matplotlib(backend):'
310 # magic of switch_backend().
310 # magic of switch_backend().
311 matplotlib.rcParams['backend'] = backend
311 matplotlib.rcParams['backend'] = backend
312
312
313 import matplotlib.pyplot
313 # Due to circular imports, pyplot may be only partially initialised
314 matplotlib.pyplot.switch_backend(backend)
314 # when this function runs.
315 # So avoid needing matplotlib attribute-lookup to access pyplot.
316 from matplotlib import pyplot as plt
315
317
316 # This must be imported last in the matplotlib series, after
318 plt.switch_backend(backend)
317 # backend/interactivity choices have been made
318 import matplotlib.pyplot as plt
319
319
320 plt.show._needmain = False
320 plt.show._needmain = False
321 # We need to detect at runtime whether show() is called by the user.
321 # We need to detect at runtime whether show() is called by the user.
General Comments 0
You need to be logged in to leave comments. Login now