On Thu, Jul 19, 2012 at 11:34 PM, JonBL <jc.bl...@bigpond.net.au> wrote:

>
> I have a Python program which calls matplotlib's show() method to display a
> plot, but control does not return to my program until I close the displayed
> figure. I want control to immediately return to my program so that I can
> display additional figures as well.
>
> The doco (matplotlib 1.1.1) for the show() method mentions an experimental
> key word arg named 'block', that can be set to True or False. This looks
> promising, but plt.show(block = False) raises type error "got an unexpected
> keyword argument 'block'". A call to plt.show() works fine. The method
> appears to accept no arguments.
>
> Can anyone suggest how to bypass the blocking behaviour of the show()
> method?
>
> TIA,
>   Jon
>

"The only thing worse than no comments are outdated comments"

IIRC, "block" was long removed from matplotlib.  If you want non-blocking
behavior, just call "plt.ion()" to turn interactivity on.  There are other
approaches to this problem that you would want to examine if you were truly
embedding into an application, but in the most simple cases, just turning
interactivity on should do the trick.

Cheers!
Ben Root
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to