Jupyter shows plot without plt.show()

前端 未结 2 1842
孤城傲影
孤城傲影 2021-01-12 07:49

I am using the Jupyter notebook with Python 2.7. Importing matplotlib like this:

%matplotlib inline    
import matplotlib.pyplot as plt

But

相关标签:
2条回答
  • 2021-01-12 08:28

    You turn on the immediate display with %matplotlib inline.

    The line:

    [<matplotlib.lines.Line2D at 0x91615d0>]
    

    is no error message. It is the return value of the last command. Try adding a ; at the end of the last line to suppress this.

    0 讨论(0)
  • 2021-01-12 08:42

    The requirement of adding %matplotlin inline is no longer needed in the latest jupyter notebooks. It's a by default addition now.

    You can change settings in ipython_kernel_config.py for different behaviour

    0 讨论(0)
提交回复
热议问题