JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
478 stars 88 forks source link

GUI Freezes when Julia is busy #345

Closed jebej closed 6 years ago

jebej commented 6 years ago

I'm sure that's a well known problem (though I couldn't find any issues about it).

As the title says, when a plot window is open, but Julia is busy, it is not possible to interact with it. Is this something that is possible to fix?

stevengj commented 6 years ago

No, because the event loop only in a separate task ("green thread") not a true OS thread. If you want to interact with the plot during a long computations, you have to give it some cycles, e.g. by calling yield() occasionally.

(If you are plotting in a Jupyter notebook, the other alternative is to use something like Plotly that does interaction with JavaScript, so that it doesn't need any cycles from Julia.)