matplotlib plot 绘图函数发生阻塞(block)时的解决方法

来源:互联网 发布:sqlserver mm dd 编辑:程序博客网 时间:2024/06/06 07:36

Is there a way to detach matplotlib plots so that the computation can continue?

  • 在一般编辑器中:

    from matplotlib.pyplot import plot, draw, showplot([1,2,3])draw()print 'continue computation'# at the end call show to ensure window won't close.show()
  • 在交互(interactive)模式下(比如 IPython):

    from matplotlib.pyplot import plot, ion, showion() # enables interactive modeplot([1,2,3]) # result shows immediatelly (implicit draw())print 'continue computation'# at the end call show to ensure window won't close.show()
0 0
原创粉丝点击