Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Update plot, remove old data show new data

オープン
#542 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

issue に示されている _make_empty_graph と _make_graph のエントリーポイントから始め、FigureCanvasTkAgg のセットアップと graph_frame のクリーンアップを含めます。plotting API が既存の figure の置き換えをどのように処理するか、また要求された空の初期グラフと後続のインジケーターがサポートされているかを確認します。完了とするには、文書化され合意されたアプローチが必要ですが、具体的なリポジトリファイルやテストは特定されていません。

索引モデルが issue の本文から書いたものです。

説明

question

Thanks for an amazing library!

I'm trying to create an application where the user can select a ticker and then click a button that prints candlesticks for the ticker. I'm plotting the graph inside a frame in Tkinter.

image

The user can select a ticker in the drop down and Graph the data for the ticker.

image

I first create the empty graph

def _make_empty_graph(self):

    self.fig = mpf.figure()     
    self.canvas = FigureCanvasTkAgg(self.fig, self.graph_frame)
    self.canvas.get_tk_widget().pack()

I then create the graph with data from a dataframe, after the user has selected a ticker and clicked "Graph". I destroy the children in the frame to not add another graph under the previous graph. The user can then select yet another ticker and graph it.

def _make_graph(self, ticker_data=None):

    self._get_ticker_data()

    for widgets in self.graph_frame.winfo_children():
        widgets.destroy()

    self.fig, _ = mpf.plot(self.ticker_df, type='candle', 
        title = f'{self.ticker_var.get()}',
        volume=True, style='binance', returnfig=True)


    self.canvas = FigureCanvasTkAgg(self.fig, self.graph_frame)
    self.canvas.get_tk_widget().pack()

Can I solve this a bit more elegant by using subplots or similar and then just clear the graph before I create the new graph? I still want to show an empty graph in the beginning. Do I need to create the empty graph in some other way to be able to update it later? Later on I like to add buttons to be able to RSI, Bollinger bands etc. on top the candlesticks.

Suggestions are greatly appreciated.

主要言語
Python
スター
4.4k
フォーク
678
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

matplotlib/mplfinance のほかの issue

matplotlib/mplfinance の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。