
- Jupyter 教程
- Jupyter - 首頁
- IPython
- IPython - 簡介
- IPython - 安裝
- IPython - 開始使用
- 執行和編輯 Python 指令碼
- IPython - 歷史命令
- IPython - 系統命令
- IPython - 命令列選項
- 動態物件自省
- IPython - I/O 快取
- 將 IPython 設定為預設 Python 環境
- 匯入 Python Shell 程式碼
- IPython - 嵌入 IPython
- IPython - 魔術命令
- Jupyter
- Jupyter 專案 - 概述
- Jupyter Notebook - 簡介
- 線上使用 Jupyter
- 安裝和開始使用
- Jupyter Notebook - 儀表板
- Jupyter Notebook - 使用者介面
- Jupyter Notebook - 單元格型別
- Jupyter Notebook - 編輯
- Jupyter Notebook - Markdown 單元格
- 單元格魔法函式
- Jupyter Notebook - 繪圖
- 轉換 Notebook
- Jupyter Notebook - IPyWidgets
- QtConsole
- QtConsole - 開始使用
- QtConsole - 多行編輯
- QtConsole - 內聯圖形
- QtConsole - 儲存為 Html
- QtConsole - 多個控制檯
- 連線到 Jupyter Notebook
- 使用 github 和 nbviewer
- Jupyter 資源
- Jupyter - 快速指南
- Jupyter - 有用資源
- Jupyter - 討論
Jupyter Notebook - 繪圖
Jupyter notebook 的 IPython 核心能夠顯示輸入單元格中程式碼的繪圖。它與matplotlib庫無縫協作。使用%matplotlib魔法函式的內聯選項即使沒有呼叫繪圖物件的show()函式也能渲染單元格外的繪圖。show()函式會導致圖形顯示在下面的`in[]`單元格下方,沒有帶編號的`out[]`。

現在,在末尾新增plt.show()並再次執行單元格以檢視區別。
請注意,%matplotlib notebook 魔法函式會渲染互動式繪圖。
在圖形下方,您可以找到一個工具欄,用於切換檢視、平移、縮放和下載選項。

重要的是,如果您修改繪圖下面的資料,顯示會動態更改,而無需繪製另一個繪圖。
在上面的示例中,更改下面單元格中 x 和 y 的資料集並再次繪製圖形,上面的圖形將動態重新整理。

廣告