On Thu, Jul 8, 2010 at 9:16 AM, Neal Becker <ndbeck...@gmail.com> wrote:
> Thanks for the info, but I still think this is rude behavior for a python
> module, and believe it would be a good thing to fix it.

Generally we try and make it easy for the user to express their
intention rather than guess what they are trying to do.  So you can
set your backend in an rc file

  http://matplotlib.sourceforge.net/users/customizing.html

or harcode it in your script (before importing pylab/pyplot)

  import matplotlib
  matplotlib.use('Agg')

Or you can run your script from the command line with the -d flag

  python myscript.py -dAgg  # will generate PNG, no GUI
  python myscript.py -dGTKAgg  # will popup a GTK GUI
  python myscript.py -dTKAgg  # will popup a Tkinter GUI


This is convenient because the same script, unmodified, can either be
used in a headless or a GUI environment.

We support 6 user interface toolkits across 4 or more operating
systems and many UI, python and OS versions.  We basically decided it
is too hard to guess what a user is trying to do across these
environments (embedding in apps, web app servers, headless scripts
generating PNG, working interactively from the shell), so we try to
make it easy for them to express their preferences.

If you have concrete suggestions on how we might accurately do this
detection in these scenarios, feel free to contribute, but a solution
that works for one environment, windowing system, or user interface
toolkit is of limited use.

See also

  http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend

JDH

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to