Any way to turn off interactive mode?

My default mode of matplotlib is interactive mode, but in

    > some programs I like to turn off the interactive model
    > temporarily so postpone drawing until I call show(), because
    > of performance concern. Any way for swith the mode in a
    > script? Thanks in advance.

from matplotlib import interactive
from matplotlib.matlab import *

plot([1,2,3])
interactive(False) # turn off interactive mode
xlabel('hi mom')
ylabel('bye')
title('all done')
interactive(False) # turn it back on
draw() # draw the canvas

JDH

···

------------------------------------------------------- This

    > SF.Net email is sponsored by: Sybase ASE Linux Express
    > Edition - download now for FREE LinuxWorld Reader's Choice
    > Award Winner for best database on Linux.
    > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
    > _______________________________________________
    > Matplotlib-users mailing list
    > Matplotlib-users@lists.sourceforge.net
    > https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks. Let me ask another question.
How can I get the current mode?
I like to recover mode after drawing everything in non-interactive mode.
From help document, interactive() seems not to give current mode.

Daehyok Shin

John Hunter wrote:

···

from matplotlib import interactive
from matplotlib.matlab import *

plot([1,2,3])
interactive(False) # turn off interactive mode
xlabel('hi mom')
ylabel('bye')
title('all done')
interactive(False) # turn it back on
draw() # draw the canvas

JDH

    > ------------------------------------------------------- This
    > SF.Net email is sponsored by: Sybase ASE Linux Express
    > Edition - download now for FREE LinuxWorld Reader's Choice
    > Award Winner for best database on Linux.
    > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
    > _______________________________________________
    > Matplotlib-users mailing list
    > Matplotlib-users@lists.sourceforge.net
    > https://lists.sourceforge.net/lists/listinfo/matplotlib-users