On Thu, Jul 8, 2010 at 9:53 AM, Neal Becker wrote:
> Use case is I have a module that does digital design. If run as main, it
> has a little test that does a plot. The plot is supposed to use a gui and
> display.
>
> But if not run as main, there is no plot, and maybe no display.
>
> I had:
>
>
ists.sourceforge.net
Subject: Re: [matplotlib-devel] nasty import behavior
It's not that simple. In order to get text metrics and start laying out
a plot for some backends (notably Gtk and Wx), the GUI framework needs
to be imported. Sure, we could import them on demand once the user
a
It's not that simple. In order to get text metrics and start laying out
a plot for some backends (notably Gtk and Wx), the GUI framework needs
to be imported. Sure, we could import them on demand once the user
actually starts doing stuff, but that would require sprinkling the code
with "impor
Use case is I have a module that does digital design. If run as main, it
has a little test that does a plot. The plot is supposed to use a gui and
display.
But if not run as main, there is no plot, and maybe no display.
I had:
if __name__ == "__main__":
from matplotlib.pyplot import *
bu
On Thu, Jul 8, 2010 at 9:16 AM, Neal Becker 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
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.
Michael Droettboom wrote:
> You need to set your backend to a non-GUI one (such as Agg) if you want
> to run without a display. This FAQ answer may be helpful:
>
>
You need to set your backend to a non-GUI one (such as Agg) if you want
to run without a display. This FAQ answer may be helpful:
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
Mike
On 07/08/2010 08:26 AM, Neal Becker wrote:
A python module of mi
A python module of mine could draw a plot, and so imports from matplotlib.
Actually, plotting is part of the module test that is in
if __name__==__main__
But this kills my job trying to run non-interactively.
This is IMO rather nasty behavior. matplotlib should not try to open the
display ju