I cannot seem to get consistent plotting behavior across platforms without using a kludgy work-around.
I have a python library that produces plots using matplotlib. A user of this library would call several high-level functions that happen to also produce plots, e.g.,
Each of the above functions calls show(), producing a plot (three total). On Linux (with GTKAgg? -- the default for Fedora 6), this works as expected. Closing the first plot causes the second to be produced, and so forth.
On MacOS usng MacPython 2.5.1 and the latest SciPy Superpack (with TkAgg or WXAgg) this does not work. The first function calls show(), which evidently turns on interactive mode and then turns the execution over to the GUI. After the first plot is closed this results in the other 2 plots being drawn interactively and then closed immediately.
From the FAQ, it seems that the desired behavior would be obtained via Metric* each calling draw(), and then the user's script should call show() after all calls to Metric*. This seems very unclean to me.
Without going through all of the hassle of compiling the requirements for GTKAgg on the Mac, is it possible to obtain the same behavior on both platforms?