On Sat, Nov 13, 2010 at 12:06 PM, Eric Firing <efiring@...> wrote:
> On 11/13/2010 06:16 AM, Michiel de Hoon wrote:
> > --- On Sat, 11/13/10, John Hunter<jdh2358@...> wrote:
> >> Ie if we have a script like
> >> # some plotting commands
> >> ...
> >> # some expensive non GUI computation
> >> ...
> >> # some update to plot above
> >> ...
> >> Would we not run the risk that the GUI is idle in the non
> >> GUI computation and therefore trigger a draw in it's thread,
> >> and then do redraws again after the update code?
> > In the MacOSX backend, everything is single-threaded, so this won't
> > I am not sufficiently familiar with the non-MacOSX backends to give a
> detailed answer, but with multiple threads the "idle" refers to the Python
> thread being idle rather than the GUI thread being idle. In other words,
> when there are no more Python commands left to be handled, the GUI thread is
> notified that it should start redrawing.
> In the gtk backend, draw_idle calls gobject.idle_add
> Thus, "idle" means the gui event loop has no higher priority events. Is
> this condition reached only at the end of the script?
> >> Are you proposing that we can get rid of the interactive setting
> >> entirely, always call draw on pyplot commands, and let the
> >> idle handler save us from doing repeated draws?
> Reminder: the interactive setting controls draw_if_interactive, which is
> what we are talking about here, but also whether or not show() blocks.
> So we may not need draw_if_interactive, but unless we can dispense with
> show entirely, we will still need an interactive setting.
> Returning to the issue raised by the OP, however, the question is
> whether the present MacOSX behavior (windows pop up) or the non-MacOSX
> behavior (they don't in non-interactive mode until/unless show() is
> called) is what we really want. It seems to me that we should preserve
> some way of getting this second behavior.
> > Yes (I assume you mean to always call draw_idle on pyplot commands). If
> there are then still cases where we do get repeated draws, then that is a
> > Best,
> > --Michiel.
I would like to cast a vote of support for the "interactive=False" setting.
I often do work on my netbook, and having a figure window pop up while I am
testing out some commands disrupts my workflow. When I want to see all my
figures, I will call show() when I am good and ready. And just as I often
do work on my netbook, I also do plenty of work on my workstation which
sports a large screen. In many cases on that machine, I would like to see
my figures while I am working on them, and having an easy option to turn
that on and off is valuable to me.
interactive : False was one of several reasons why I switched from Matlab to
On the issue about the OP, I am a little bit confused as to what the exact
issue is at hand. Is it that a figure window pops up in macosx backend
regardless of the interactive setting? Or is it that non-macosx backends
are not behaving the same way on a mac as they do on other systems? Is the
issue that the plot window is blank on the macosx backend until the script
finishes? I guess I am a little confused here.