From: W. Trevor King Date: Wed, 20 Oct 2010 07:10:51 +0000 (-0400) Subject: Reposition matplotlib.use() call in velocity_dependant_scan.py. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e0980d09a0aac2f93d0df4a0338025ae98ab175;p=sawsim.git Reposition matplotlib.use() call in velocity_dependant_scan.py. 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. --- diff --git a/pysawsim/velocity_dependant_scan.py b/pysawsim/velocity_dependant_scan.py index 72b4d07..c54cf29 100644 --- a/pysawsim/velocity_dependant_scan.py +++ b/pysawsim/velocity_dependant_scan.py @@ -24,6 +24,7 @@ import shutil import sys import matplotlib +matplotlib.use('Agg') # select backend that doesn't require X Windows import numpy import pylab from scipy.optimize import leastsq @@ -34,7 +35,6 @@ from .manager import MANAGERS, get_manager 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.