def location_plot(title, colors):
output_file(title + ".html")
location_source = ColumnDataSource(
data={
"x": whisky[" Latitude"],
"y": whisky[" Longitude"],
"colors": colors,
"regions": whisky.Region,
"distilleries": whisky.Distillery
}
)
fig = figure(title=title,
x_axis_location="above", tools="resize, hover, save")
fig.plot_width = 400
fig.plot_height = 500
fig.circle("x", "y", 10, 10, size=9, source=location_source,
color='colors', line_color=None)
fig.xaxis.major_label_orientation = np.pi / 3
hover = fig.select(dict(type=HoverTool))
hover.tooltips = {
"Distillery": "@distilleries",
"Location": "(@x, @y)"
}
show(fig)
评论列表
文章目录