散景时间序列绘图

Bokeh time series plotting

我有一堆时间序列 objects 我正在用 bokeh.charts.TimeSeries 数据绘制图表,我想将这些数据制作成带有描述和标题等的漂亮图表。如何添加bokeh.plotting.figure object 的图表?我正在使用 bokeh.layouts.row 来组织它们,但我想让它看起来比只有图表的网页更专业。

这可能吗?我正在查看绘图界面,但没有看到时间序列 API。我会使用我的 pandas.Series object 作为行 API 的数据吗?

旧的 bokeh.charts API,包括 TimeSeries 已弃用并随后被删除。您可以而且应该使用稳定的 bokeh.plotting API 绘制时间序列。这是使用 Bokeh 0.13.0:

创建的完整示例
from bokeh.plotting import figure, show
from bokeh.sampledata.glucose import data

p = figure(x_axis_type="datetime", title="Glocose Range", plot_height=350, plot_width=800)
p.xgrid.grid_line_color=None
p.ygrid.grid_line_alpha=0.5
p.xaxis.axis_label = 'Time'
p.yaxis.axis_label = 'Value'

p.line(week.index, week.glucose)

show(p)