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