Non-interactive use always tries to load wx

"Daniel O'Connor" <darius@...1745...> writes:

I am trying to use matplotlib non-interactively but if I don't have
DISPLAY set then wx barfs even though I have tried forcing the backend,
etc..

This should probably be in the FAQ... you need to set the backend before
you import pylab, because importing pylab reads your matplotlibrc file
and does all sorts of setup:

import matplotlib
matplotlib.use('agg')
import pylab

···

--
Jouni K. Sepp�nen
http://www.iki.fi/jks

Ahah, thanks - works much better now, I wondered why I couldn't affect
the backend :slight_smile:

In the FAQ would be very nice!

PS thanks to all the devs for matplotlib, it is very useful!

···

On Tue, 2 Oct 2007, Jouni K. Seppänen wrote:

"Daniel O'Connor" <darius@...1745...> writes:
> I am trying to use matplotlib non-interactively but if I don't have
> DISPLAY set then wx barfs even though I have tried forcing the
> backend, etc..

This should probably be in the FAQ... you need to set the backend
before you import pylab, because importing pylab reads your
matplotlibrc file and does all sorts of setup:

import matplotlib
matplotlib.use('agg')
import pylab

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C