Appreciating your time and effort to go through my code and helping me to find the solution. I am using FuncAnimation of Matplotlib to refresh/update my plot every 1min.
The Data is extracted using Yahoo finance every 1min. But I am getting following error:
in _draw_frame self._drawn_artists = self._func(framedata, *self._args) TypeError: 'NoneType' object is not callable
Below is my code:
import yfinance as yf
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def Get_Data():
Data = yf.download(tickers="VIPIND.NS",interval="1m", period="1d")
Data.reset_index(inplace = True)
Data['Datetime'] = Data['Datetime'].dt.tz_convert('Asia/Kolkata').dt.tz_localize(None)
Data['Datetime'] = pd.to_datetime(Data['Datetime'])
Data=Data.set_index('Datetime')
print("Refreshed")
plt.figure(1)
plt.cla()
plt.xticks()
plt.plot(Data['Close'], linewidth = 2)#,label = f'Close at {Data.index[-1]}')
plt.title(f'Close Price at {Data.index[-1]}')
plt.xlabel("Time")
plt.show()
return
LivePlot = FuncAnimation(plt.gcf(),Get_Data(),interval=60000)
Please guide me on where am I going wrong ? and how to resolve this issue.
Regards Sudhir