def mplot2d(f, var, show=True):
 import warnings
 warnings.filterwarnings('ignore', 'Could not match \\S')
 p = import_module('pylab')
 if (not p):
  sys.exit('Matplotlib is required to use mplot2d.')
 if (not is_sequence(f)):
  f = [f]
 for f_i in f:
  (x, y) = sample(f_i, var)
  p.plot(x, y)
 p.draw()
 if show:
  p.show()

def mplot2d ( f , var , show = True ) : import warnings warnings . filterwarnings ( 'ignore' , 'Could not match \\S' ) p = import_module ( 'pylab' ) if ( not p ) : sys . exit ( 'Matplotlib is required to use mplot2d.' ) if ( not is_sequence ( f ) ) : f = [ f ] for f_i in f : ( x , y ) = sample ( f_i , var ) p . plot ( x , y ) p . draw ( ) if show : p . show ( )
plot a 2d function using matplotlib/tk .