How to Turn Off Blocking by Method show()

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

···

--
View this message in context: http://old.nabble.com/How-to-Turn-Off-Blocking-by-Method-show()-tp34188043p34188043.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Solved - just discovered methods ion() and ioff() which do the job.

JonBL 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

--
View this message in context: http://old.nabble.com/How-to-Turn-Off-Blocking-by-Method-show()-tp34188043p34188078.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

“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

···

On Thu, Jul 19, 2012 at 11:34 PM, JonBL <jc.blake@…636…> 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