matplotlib / matplotlib/mplfinance

how can I embed my mplfinance graph(mpf_animation_demo1.py) in Tkinter ?

Open
#308 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

Ask anything you want about mplfinance usage, project philosophy and/or priorities, or anything else related to mplfinance.
Display the following animation graph on the tkinter,environment:python3.6 +windows10 desktop
Below is mpf_animation_demo1.py:
```python
import pandas as pd
import mplfinance as mpf
import matplotlib.animation as animation

idf = pd.read_csv('data/SPY_20110701_20120630_Bollinger.csv',index_col=0,parse_dates=True)
idf.shape
idf.head(3)
idf.tail(3)
df = idf.loc['2011-07-01':'2011-12-30',:]

fig = mpf.figure(style='charles',figsize=(7,8))
ax1 = fig.add_subplot(2,1,1)
ax2 = fig.add_subplot(3,1,3)

def animate(ival):
if (20+ival) > len(df):
print('no more data to plot')
ani.event_source.interval *= 3
if ani.event_source.interval > 12000:
exit()
return
data = df.iloc[0:(20+ival)]
ax1.clear()
ax2.clear()
mpf.plot(data,ax=ax1,volume=ax2,type='candle')

ani = animation.FuncAnimation(fig, animate, interval=250)

mpf.show()
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided mpf_animation_demo1.py example and reviewing how it creates the mplfinance figure and animation. Investigate how that figure can be hosted in a Tkinter desktop window on Python 3.6 and Windows 10; done means the candle animation displays and updates inside Tkinter.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data-visualization, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.