本文整理汇总了Python中bokeh.models.GMapPlot.select_one方法的典型用法代码示例。如果您正苦于以下问题:Python GMapPlot.select_one方法的具体用法?Python GMapPlot.select_one怎么用?Python GMapPlot.select_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bokeh.models.GMapPlot
的用法示例。
在下文中一共展示了GMapPlot.select_one方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plotColumnDataSource
# 需要导入模块: from bokeh.models import GMapPlot [as 别名]
# 或者: from bokeh.models.GMapPlot import select_one [as 别名]
# )
# )
source = plotColumnDataSource(data=dict(
x=[-71.0589, -71.2644],
y=[42.3601, 42.2926],
name=['Boston', 'Olin'],
address=['Boston Rite Aid', 'Olin The Awesomest']
))
circle = Circle(x="x", y="y", size=15, fill_color="blue", fill_alpha=0.8, line_color=None)
plot.add_glyph(source, circle)
TOOLS="pan,wheel_zoom,box_zoom,reset,hover,save"
p = figure(title="Our Map", tools=TOOLS)
plot.add_tools(PanTool(), WheelZoomTool(), BoxSelectTool(), HoverTool())
hover = plot.select_one(HoverTool)
hover.point_policy = "follow_mouse"
hover.tooltips = [
('Name', '@name'),
('Title', '@address')
# ("(Long, Lat)", "($x, $y)"),
]
# plot.add_tools(PanTool(), WheelZoomTool(), BoxSelectTool(), hover())
output_file("gmap_plot.html")
show(plot)
示例2: ColumnDataSource
# 需要导入模块: from bokeh.models import GMapPlot [as 别名]
# 或者: from bokeh.models.GMapPlot import select_one [as 别名]
lad_unemployment= unemp2011[unemp2011['LAD'].isin(lad_names)]
col = colors*1200
source = ColumnDataSource(data=dict(
y=lad_lats,
x=lad_longs,
color=col[:len(set(lad_names))],
name=lad_names,
unemployment=lad_unemployment.Unemployment
))
TOOLS="pan,wheel_zoom,box_zoom,reset,hover,save"
p = GMapPlot(title="LAD", plot_width=1200, plot_height=800, x_range = Range1d(), y_range = Range1d(), map_options = GMapOptions(lat=51.5074, lng=0.1278, zoom=10))
p.map_options.map_type = "terrain"
patch = Patches(xs="x", ys="y", fill_color="color", fill_alpha=0.7, line_color="black", line_width=0.5)
patches_glyph = p.add_glyph(source, patch)
p.add_tools(PanTool(), WheelZoomTool(), BoxSelectTool(), HoverTool(), ResetTool(), PreviewSaveTool())
hover = p.select_one(HoverTool)
hover.point_policy = "follow_mouse"
hover.tooltips = [
("Name", "@name"),
("(Lat, Long)", "($y, $x)"),
("Unemployment Rate 2011","@unemployment")
]
output_file("LADGMap.html", title="LAD GMap test", mode="cdn")
show(p)