0
我需要此幫助。 情節是好的,但當我徘徊在點時,我得到了S的價格作爲Y(這是正確的),而不是日期爲X我得到一個時間戳。 有沒有人能夠解決它?謝謝!使用mpld3繪製日期標籤
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins
import pandas.io.data as pdweb
import datetime
mpld3.enable_notebook()
%matplotlib inline
price = pdweb.get_data_yahoo("^GSPC",start = datetime.datetime(2014,1,1),end=datetime.datetime(2016,6,30))['Adj Close']
fig, ax = plt.subplots(figsize=(12,8))
ax.plot(price.index, price, lw=1)
points = ax.scatter(price.index, price, alpha=0.1)
plugins.connect(fig, plugins.LineLabelTooltip(points))
非常感謝,但我得到這個錯誤..任何想法如何解決它?再次感謝 – MrFed
AttributeError:'str'對象沒有屬性'strftime' – MrFed