##// 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 159 properly handle interactive rendering."""
160 160
161 161 import matplotlib
162 import matplotlib.pylab as pylab
162 import matplotlib.pyplot as plt
163 163
164 164 #print '*** Matplotlib runner ***' # dbg
165 165 # turn off rendering until end of script
@@ -168,9 +168,10 b' def mpl_runner(safe_execfile):'
168 168 safe_execfile(fname,*where,**kw)
169 169 matplotlib.interactive(is_interactive)
170 170 # make rendering call now, if the user tried to do it
171 if pylab.draw_if_interactive.called:
172 pylab.draw()
173 pylab.draw_if_interactive.called = False
171 if plt.draw_if_interactive.called:
172 plt.draw()
173 plt.draw_if_interactive.called = False
174
174 175
175 176 return mpl_execfile
176 177
@@ -297,12 +298,12 b' def activate_matplotlib(backend):'
297 298
298 299 # This must be imported last in the matplotlib series, after
299 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 304 # We need to detect at runtime whether show() is called by the user.
304 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 309 def import_pylab(user_ns, import_all=True):
General Comments 0
You need to be logged in to leave comments. Login now