In 0.63, we introduced a flag on the
matplotlib.backends.draw_if_interactive function. If
I must say I'm really impressed how fast matplotlib gets improved!
Eg , at the end of your script
if draw_if_interactive._called: show()
Note if you are using a pure image backend (eg agg, svg, ps) you do
not need show at all; this is for GUI backends only. Just call
savefig anywhere in your code.
Perfect! This is exactly what I needed for one of my apps.
But if you really want full control with no magic globals, I suggest
using the matplotlib API rather than the matlab interface. Here is a
minimal example with the SVG backend to create a figure w/o the matlab
Well, what do you exactly mean by full control? The fact that the figure is no more controlled by matplotlib.matlab (as matlab does) but under my own control? So that the application is now fully responsible for displaying it? I'm afraid I don't understand why this should remove "magic" globals, I feel some globals are still required...
NB: currently I'm targeting TkAgg.