def instaprint(figure='<STR_LIT>', arguments='<STR_LIT>', threaded=False, file_format='<STR_LIT>'):
global _settings<EOL>if '<STR_LIT>' not in _settings.keys():<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT>if   figure=='<STR_LIT>': figure=[_pylab.gcf().number]<EOL>elif figure=='<STR_LIT:all>': figure=_pylab.get_fignums()<EOL>if not getattr(figure,'<STR_LIT>',False): figure = [figure]<EOL>print("<STR_LIT>", figure)<EOL>figures=[]<EOL>for n in figure: figures.append(_pylab.figure(n))<EOL>if threaded:<EOL><INDENT>canvas_type = type(figures[-<NUM_LIT:1>].canvas)<EOL>_thread.start_new_thread(_print_figures, (figures,arguments,file_format,))<EOL>_time.sleep(<NUM_LIT>)<EOL>t0 = _time.time()<EOL>while not canvas_type == type(figures[-<NUM_LIT:1>].canvas) and _time.time()-t0 < <NUM_LIT>:<EOL><INDENT>_time.sleep(<NUM_LIT:0.1>)<EOL><DEDENT>if _time.time()-t0 >= <NUM_LIT>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>_pylab.draw()<EOL><DEDENT>else:<EOL><INDENT>_print_figures(figures, arguments, file_format)<EOL>_pylab.draw()<EOL><DEDENT>
Quick function that saves the specified figure as a postscript and then
calls the command defined by spinmob.prefs['instaprint'] with this
postscript file as the argument.

figure='gcf'    can be 'all', a number, or a list of numbers