Skip to content

Instantly share code, notes, and snippets.

@AntonioMarsella
Last active March 19, 2020 14:03
Show Gist options
  • Save AntonioMarsella/2e776030d3226f5cf26ceb5106c72ade to your computer and use it in GitHub Desktop.
Save AntonioMarsella/2e776030d3226f5cf26ceb5106c72ade to your computer and use it in GitHub Desktop.
bokeh plotting tools
plot = figure(tools='box_select, lasso_select')
plot.circle(petal_length, sepal_length, selection_color='red', nonselect_fill_alpha=0.2, nonselection_fill_color='grey')
#to apport change to the visual appearance
from bokeh.models import HoverTool
#it doesn't display the tooltips and shows an horizontal line under the mouse position for the inspection
hover = HoverTool(tooltips=None, mode='hline')
plot = figure(tools[hover, 'crosshair'])
plot.circle(x, y, size=15, hover_color='red')
#######
# import the HoverTool
from bokeh.models import HoverTool
# Add circle glyphs to figure p
p.circle(x, y, size=10,
fill_color='grey', alpha=0.1, line_color=None,
hover_fill_color='firebrick', hover_alpha=0.5,
hover_line_color='white')
# Create a HoverTool: hover
hover = HoverTool(tooltips=None, mode='vline')
p.add_tools(hover)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment