本文整理汇总了Python中bokeh.models.GMapPlot.on_change方法的典型用法代码示例。如果您正苦于以下问题:Python GMapPlot.on_change方法的具体用法?Python GMapPlot.on_change怎么用?Python GMapPlot.on_change使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bokeh.models.GMapPlot
的用法示例。
在下文中一共展示了GMapPlot.on_change方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from bokeh.models import GMapPlot [as 别名]
# 或者: from bokeh.models.GMapPlot import on_change [as 别名]
gradient = []
for ii in range(7):
gradient += range(25)
gradient = np.array(gradient)
gradient = gradient/24.
gradient = gradient.reshape(1,-1)
fig = figure(x_range = (0,10080), y_range = (0,16))
def get_trains_week(stat_code):
sbn.set_style("white")
stat_vals = dis_trains[dis_trains.code == stat_code]
all_trains = stat_vals.times.values
xx = all_trains
days = np.array(xx[0])/1440
tot_mins = np.array(xx[0])%1440
hour = tot_mins/60
mins = tot_mins % 60
train_time = zip(days,hour,mins)
hist, edges = np.histogram(xx[0], bins = range(0,10081,120))
d = np.sin(3*gradient)
fig.image(image = [d],x = 0, y = 0, dw = 10080, dh = max(hist)+1)
fig.quad(top=hist, bottom=0, left=edges[:-1],right=edges[1:],fill_color="#036564",line_color="#033649")
fig.xaxis[0].ticker=FixedTicker(ticks=[])
fig.xaxis.major_label_orientation = "vertical"
# output_file("test_bg_image.html", title = "Background image")
show(fig)
plot.on_change('selected',get_trains_week)