I want to set the matplotlib backend from within my script. I can do this 
if I run my script from a shell/terminal, but from Spyder I get an error. 
Here is the full error message:


/usr/local/lib/python2.6/dist-packages/matplotlib-1.0.1-py2.6-linux-x86_64.egg/matplotlib/__init__.py:888:
 
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.

 if warn: warnings.warn(_use_error_msg)

I searched this list and found this old message that seems related:
https://groups.google.com/d/msg/spyderlib/rAWkNkGWpK0/1fII0P5leowJ 


Here is a snippet from my script:

#!/usr/bin/env python

"""
    Bore data plotting routine
"""
# if needed set the backend before importing pyplot:
import matplotlib
matplotlib.use("PS")

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc

... commands ...

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/spyderlib/-/tH5mr59C11MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/spyderlib?hl=en.

Reply via email to