当前位置: 首页>>代码示例>>Python>>正文


Python GMapPlot.on_change方法代码示例

本文整理汇总了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)
开发者ID:ajithpad,项目名称:Indian_railways,代码行数:32,代码来源:combined_map.py


注:本文中的bokeh.models.GMapPlot.on_change方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。