How do I fix the deprecation warning that comes with pylab.pause?
Question: A short python program to demonstrate a bug I keep running into:

    
    
    import pylab
    pylab.ion()
    pylab.title('doom')
    pylab.pause(0)
    

If I run it, it works fine, but I get this warning:

    
    
    /usr/lib/pymodules/python2.7/matplotlib/backend_bases.py:2280: MatplotlibDeprecationWarning: Using default event loop until function specific to this GUI is implemented
    

If I remove the pause line, then I don't get the warning, but my plot ceases
to exist as soon as the program finishes.

I should like an elegant way to get the behaviour without the warning. Can
anyone help?


Answer: It looks like
[waitforbuttonpress](http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.waitforbuttonpress)
should do what you want. Just replce the `pause` with
`pylab.waitforbuttonpress(timeout=-1)`.

