def create_mpl_ax(ax=None):
 if (ax is None):
  plt = _import_mpl()
  fig = plt.figure()
  ax = fig.add_subplot(111)
 else:
  fig = ax.figure
 return (fig, ax)

def create_mpl_ax ( ax = None ) : if ( ax is None ) : plt = _import_mpl ( ) fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) else : fig = ax . figure return ( fig , ax )
helper function for when a single plot axis is needed .