我是Python新手,我只是在iPython Notebook中繪製了一個非常簡單的圖形。在iPython Notebook中使用matplotlib.pyplot
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()
這是我寫的,期待一個簡單的對角線圖,但是當我運行它時,根本沒有任何打印。
如果我刪除
plt.show()
我得到這個作爲輸出:
[<matplotlib.lines.Line2D at 0x109fcdb50>]
如何獲得劇情說明了什麼?
好吧,我發現我需要 %matplotlib直列 添加到頂部。 – user4794127