matplotlib / matplotlib/ipympl
Need to create and update figures in seperate cells?
まだ誰も着手していません。
- 主要言語
- Jupyter Notebook
- スター
- 1.7k
- フォーク
- 234
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Something I've seen in previous versions as well as the current version: In order to have a figure that dynamically updates while some code is executing (e.g. tracking the loss function of an optimization), I have to create the figure in a separate jupyter notebook cell and run it before a I run the code that updates. If I don't do this, then a blank figure shows and never updates. I'm using Jupyter lab. Wondering if I'm doing something wrong here? It would make the code cleaner and easier to run if it could all be put in a single cell.
Example:
Using the following function:
def update_function(fig, ax):
while True:
# Do some computation
ax.clear() #clear previously drawn
ax.plot(some_data)
fig.canvas.draw() #force it to update
This works:
# cell 1
fig, ax = plt.subplots()
# cell 2
update_function(fig, ax)
But this does not:
# one combined cell
fig, ax = plt.subplots()
update_function(fig, ax)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue では、リポジトリのファイルもテストも指定されていません。まず JupyterLab で別々のセルと結合したセルの例を再現し、その後、長時間実行される update_function がレンダリングに与える影響を比較します。結合したセルが要求どおりに図を更新するか、または issue に確認済みの制限とその正しい workaround が記載されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- jupyter, jupyter-notebook, python
- 領域
- data-visualization, frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100