我有一个pandas数据帧,时间戳作为索引和列中的数值.我想使用broken_bar绘制矩形以突出显示时间序列的某些部分.如何使用broken_barh的时间戳?
df.plot(ax = ax)
ax.broken_barh([(startTs, pd.offsets.Week())], (10,50), facecolors = colors, alpha = 0.25)
# Where type(startTs) is pandas.tslib.Timestamp
Run Code Online (Sandbox Code Playgroud)
当我执行上面的代码片段时,我得到'参数必须是字符串或数字'错误.
提前致谢.