Canvas bokeh:空画布的不稳定行为,具有几乎相同的数据

Canvas bokeh:空画布的不稳定行为,具有几乎相同的数据,canvas,line,draw,bokeh,Canvas,Line,Draw,Bokeh,我对bokeh有一个奇怪的问题,就是如何从数据中可视化线条。我提取了给出问题的数据,并将其缩小到以下示例: import matplotlib.pyplot as plt from bokeh.plotting import figure, output_file, show fig = figure(width=1200, height=300, x_axis_type="datetime") fig.line(x=['1511550670', '1511550995', '151155

我对bokeh有一个奇怪的问题,就是如何从数据中可视化线条。我提取了给出问题的数据,并将其缩小到以下示例:

import matplotlib.pyplot as plt

from bokeh.plotting import figure, output_file, show

fig = figure(width=1200, height=300, x_axis_type="datetime")

fig.line(x=['1511550670', '1511550995', '1511551093', '1511551108'],
         y=[-99.99994912, -99.99995743, -99.99995395, -99.99995494],
         color='blue', legend='no line?')

fig.line(x=['1511550670', '1511550995', '1511551093', '1511551108'],
         y=[-0.16839438, -0.04496412, 0.14891187, 0.12161594],
         color='red', legend='line!')

output_file("overall.html")

show(fig)
这两个数据集对我来说都很好,但画布上只打印了一个。 有谁能帮我弄清楚这里到底发生了什么事吗


如果将时间戳作为字符串提供的用法在某些用例中起作用,那完全是无意和偶然的。它在任何地方都没有文档记录,也不受支持。传递实际数字时间戳按预期工作:

from bokeh.plotting import figure, output_file, show

fig = figure(width=1200, height=300, x_axis_type="datetime")

fig.line(x=[1511550670, 1511550995, 1511551093, 1511551108],
         y=[-99.99994912, -99.99995743, -99.99995395, -99.99995494],
         color='blue', legend='no line?')

fig.line(x=[1511550670, 1511550995, 1511551093, 1511551108],
         y=[-0.16839438, -0.04496412, 0.14891187, 0.12161594],
         color='red', legend='line!')

output_file("overall.html")

show(fig)

除了上述原始时间戳之外,python、pandas、numpy等的任何典型日期时间值也可以使用