pycall matplotlib non-blocking plot?


Hello, I am wondering how to do non-blocking plot:
using PyCall; plt = pyimport("matplotlib.pyplot"); plt.plot([1,2]); shows plot window, but Julia is blocked, till I close plot window; = false) does not block Julia, but does block plot GUI window, and I need to do plt.pause(5) to update plot window and use its GUI buttons (to process event loop) and during that Julia REPL is blocked, then after 5 s GUI is again blocked.
Could it be possible to pycall interactive plot without blocking GUI or Julia? In Python = false) does work for this. Maybe use of multiple threads? P.S. @async doesn’t help.

I use pycall to call matplotlib because it has quite low compile latency (Julia v1.1).


I think you need to do


Use the PyPlot package (a thin wrapper around PyCall and matplotlib), which provides a non-blocking interactive GUI via a background task. It should be nicer to use from Julia than directly doing pyimport(“matplotlib.pyplot”)


Thanks for reply, I just solved problem using :slight_smile: