Matplotlib绘图跳过时间段的处理方案
股票绘图需要跳过非交易时段绘连续图, 方法很简单:将时间格式转成文本格式即可:
// 将时间格式转成文本格式: strftime("%m%d%H%M")
x = stock_data_ana.index.strftime("%m%d%H%M")
ax.set_xticklabels(x, rotation = 45) # x label 旋转45度显示
股票绘图需要跳过非交易时段绘连续图, 方法很简单:将时间格式转成文本格式即可:
// 将时间格式转成文本格式: strftime("%m%d%H%M")
x = stock_data_ana.index.strftime("%m%d%H%M")
ax.set_xticklabels(x, rotation = 45) # x label 旋转45度显示