This fixes:
.../matplotlib/__init__.py:833: UserWarning:
This call to matplotlib.use() has no effect because the the backend
has already been chosen; matplotlib.use() must be called *before*
pylab, matplotlib.pyplot, or matplotlib.backends is imported for the
first time.
import sys
import matplotlib
+matplotlib.use('Agg') # select backend that doesn't require X Windows
import numpy
import pylab
from scipy.optimize import leastsq
from . import sawsim_histogram
-matplotlib.use('Agg') # select backend that doesn't require X Windows
FIGURE = pylab.figure() # avoid memory problems.
"""`pylab` keeps internal references to all created figures, so share
a single instance.