简体   繁体   中英

Bokeh time series plotting

I have a bunch of time series objects I'm charting with bokeh.charts.TimeSeries data that I want to make into a beautiful plot with a description and title, etc. How can I add a chart to a bokeh.plotting.figure object? I'm using bokeh.layouts.row to organise them, but I want to make it look more professional than a webpage with nothing but a chart.

Is this possible? I was looking at the plotting interface, but I don't see a time series API. Would I just use my pandas.Series objects as the data for the line API?

The old bokeh.charts API, including TimeSeries was deprecated and subsequently removed. You can and should plot time series using the stable bokeh.plotting API. Here is a complete example created with 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)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM