def draw_if_interactive():
 if matplotlib.is_interactive():
  figManager = Gcf.get_active()
  if (figManager is not None):
   figManager.canvas.invalidate()

def draw_if_interactive ( ) : if matplotlib . is_interactive ( ) : figManager = Gcf . get_active ( ) if ( figManager is not None ) : figManager . canvas . invalidate ( )
is called after every pylab drawing command .