Get Jupyter notebook to display matplotlib figures in real-time
问题 I have a long running Python loop (used for machine learning), which periodically prints output and displays figures (using matplotlib). When run in Jupyter Notebook, all the text (stdout) is displayed in real-time, but the figures are all queued and not displayed until the entire loop is done. I'd like to see the figures in real-time, on each iteration of the loop. During cell execution, not when the entire cell execution is done. For example, if my code is: for i in range(10): print(i) show