Matplotlib plots not showing up in Mac OSX?

后端 未结 13 582
梦如初夏
梦如初夏 2020-12-12 14:16

I am running Mac OSX 10.5.8. I installed matplotlib using macports. I get some examples from the matplotlib gallery like this one, without modification:

http://matpl

13条回答
  •  醉酒成梦
    2020-12-12 14:40

    After the plot simply add -

    plt.show()

    The reason this works is to do with interactive vs non-interactive mode. If the backend is opened in non-interactive mode, plt.show() is required at the end of the code chunk. You can check the status by calling plt.isinteractive() and toggle the status using plt.ion() and plt.ioff()

提交回复
热议问题