【问题标题】:Slope on bokeh time series plot散景时间序列图上的斜率
【发布时间】:2021-09-13 02:47:40
【问题描述】:

散景时间序列图中日期时间的内部表示是什么,例如,在https://docs.bokeh.org/en/latest/docs/gallery/candlestick.html 这个烛台图表中,如何绘制 45 度角的斜率? (在计算斜率/梯度时,我应该在日期时间轴上使用基于秒的纪元还是微秒?纳米?)

【问题讨论】:

    标签: python time-series bokeh


    【解决方案1】:

    看起来散景在内部使用 ms 来绘制时间序列图。所以,

    g = 1 / (24 * 3600 * 1e3)
    Slope(gradient=g, y_intercept=66 - g * (df['date'][0].timestamp() * 1e3)
    

    应该绘制 45 度斜线。

    【讨论】:

      猜你喜欢
      • 2017-03-31
      • 2014-09-08
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      • 2017-09-13
      • 1970-01-01
      • 2011-03-30
      相关资源
      最近更新 更多