The use of `returnfig=True` creates multiple figures when using ipywidgets
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- jupyter, matplotlib, python
調査の方向性
ipywidgets、mplfinance、および returnfig=True を指定した示されている plot_func を使って、JupyterLab でこの問題を再現します。まずスライダーの更新に伴う figure の作成を観察し、次にプロットのエントリポイントと figure の処理を追跡します。完了条件は、ウィジェットを繰り返し更新しても figure が追加されず、現在のプロットだけが残ることです。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
If you provide returnfig=True or use your own axes, updating the ipywidgets produces additional plots.
To Reproduce
this example uses 15 min klines, but that doesn't matter.
@interact(
start_pos = widgets.FloatSlider(value=0, max=len(df.index) - 1 - 7 * 96, min=0, step=1),
length = widgets.FloatSlider(value=7 * 96, max=7 * 96, min=96, step=96),
)
def plot_func(start_pos, length):
start_pos, length = int(start_pos), int(length)
ldf = df.iloc[start_pos:start_pos + length]
print(ldf.index[0], ' - ', ldf.index[-1])
mpf.plot(ldf, style='yahoo', figsize=(20,5), returnfig=True)
#print([ str(ax) for ax in axlist])
Expected behavior
When using ipywidgets and updateing the slider, the reloading of the plot_func produces an additional figure each time you update the widget. This shouldn't be. When your don't use returnfig (or don't add ax and volume by your own figure) this behaviour does not accure.
jupyter lab
mplfinance 0.12.10b0
Screenshots
- 主要言語
- Python
- スター
- 4.4k
- フォーク
- 678
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matplotlib/mplfinance のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
matplotlib/mplfinance#672 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
matplotlib/mplfinance#700 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
matplotlib/mplfinance#695 ·
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
matplotlib/mplfinance#691 · コメント 1 件 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
matplotlib/mplfinance#690 · コメント 5 件 ·
matplotlib/mplfinance の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·