##// END OF EJS Templates
MNT: remove unneeded pylab imports...
Thomas A Caswell -
Show More
@@ -159,7 +159,7 b' def mpl_runner(safe_execfile):'
159 properly handle interactive rendering."""
159 properly handle interactive rendering."""
160
160
161 import matplotlib
161 import matplotlib
162 import matplotlib.pylab as pylab
162 import matplotlib.pyplot as plt
163
163
164 #print '*** Matplotlib runner ***' # dbg
164 #print '*** Matplotlib runner ***' # dbg
165 # turn off rendering until end of script
165 # turn off rendering until end of script
@@ -168,9 +168,10 b' def mpl_runner(safe_execfile):'
168 safe_execfile(fname,*where,**kw)
168 safe_execfile(fname,*where,**kw)
169 matplotlib.interactive(is_interactive)
169 matplotlib.interactive(is_interactive)
170 # make rendering call now, if the user tried to do it
170 # make rendering call now, if the user tried to do it
171 if pylab.draw_if_interactive.called:
171 if plt.draw_if_interactive.called:
172 pylab.draw()
172 plt.draw()
173 pylab.draw_if_interactive.called = False
173 plt.draw_if_interactive.called = False
174
174
175
175 return mpl_execfile
176 return mpl_execfile
176
177
@@ -297,12 +298,12 b' def activate_matplotlib(backend):'
297
298
298 # This must be imported last in the matplotlib series, after
299 # This must be imported last in the matplotlib series, after
299 # backend/interactivity choices have been made
300 # backend/interactivity choices have been made
300 import matplotlib.pylab as pylab
301 import matplotlib.pyplot as plt
301
302
302 pylab.show._needmain = False
303 plt.show._needmain = False
303 # We need to detect at runtime whether show() is called by the user.
304 # We need to detect at runtime whether show() is called by the user.
304 # For this, we wrap it into a decorator which adds a 'called' flag.
305 # For this, we wrap it into a decorator which adds a 'called' flag.
305 pylab.draw_if_interactive = flag_calls(pylab.draw_if_interactive)
306 plt.draw_if_interactive = flag_calls(plt.draw_if_interactive)
306
307
307
308
308 def import_pylab(user_ns, import_all=True):
309 def import_pylab(user_ns, import_all=True):
General Comments 0
You need to be logged in to leave comments. Login now