matplotlib / matplotlib/mplfinance
how can I embed my mplfinance graph(mpf_animation_demo1.py) in Tkinter ?
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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