2011/12/15 John Thorstensen <john.thorsten...@dartmouth.edu>:

> So my question:  Is there a simple way of getting matplotlib to display a
> plot in a window and then surrender control to the main program, without
> destroying the plot?  Something like a method to kill mainloop would be
> ideal.

Just make sure you use interactive mode and get rid of the show calls:

import matplotlib.pyplot as plt
plt.ion()  # set interactive mode
plt.plot(foo)  # plot something
bar()  # do stuff while the plot is visible
plt.close()  # if you want to close the plot window from the script

This works in mpl 1.1.0 al least with tkagg, gtkagg and qt4agg backends.

Goyo

------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to