def subplot_tool(targetfig=None):
 tbar = rcParams[u'toolbar']
 rcParams[u'toolbar'] = u'None'
 if (targetfig is None):
  manager = get_current_fig_manager()
  targetfig = manager.canvas.figure
 else:
  for manager in _pylab_helpers.Gcf._activeQue:
   if (manager.canvas.figure == targetfig):
    break
  else:
   raise RuntimeError(u'Could not find manager for targetfig')
 toolfig = figure(figsize=(6, 3))
 toolfig.subplots_adjust(top=0.9)
 ret = SubplotTool(targetfig, toolfig)
 rcParams[u'toolbar'] = tbar
 _pylab_helpers.Gcf.set_active(manager)
 return ret

def subplot_tool ( targetfig = None ) : tbar = rcParams [ u'toolbar' ] rcParams [ u'toolbar' ] = u'None' if ( targetfig is None ) : manager = get_current_fig_manager ( ) targetfig = manager . canvas . figure else : for manager in _pylab_helpers . Gcf . _activeQue : if ( manager . canvas . figure == targetfig ) : break else : raise RuntimeError ( u'Could not find manager for targetfig' ) toolfig = figure ( figsize = ( 6 , 3 ) ) toolfig . subplots_adjust ( top = 0.9 ) ret = SubplotTool ( targetfig , toolfig ) rcParams [ u'toolbar' ] = tbar _pylab_helpers . Gcf . set_active ( manager ) return ret
launch a subplot tool window for *targetfig* .