Skip to content

Instantly share code, notes, and snippets.

@dela3499
Created May 18, 2017 21:17
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dela3499/e159b388258b5f1a7a3bac42fc0179fd to your computer and use it in GitHub Desktop.
Save dela3499/e159b388258b5f1a7a3bac42fc0179fd to your computer and use it in GitHub Desktop.
Bokeh scatterplot with tooltips in the Jupyter notebook
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.models import HoverTool
from bokeh.io import output_notebook
output_notebook()
source = ColumnDataSource(
data=dict(
x=[1, 2, 3, 4, 5],
y=[2, 5, 8, 2, 7],
desc=['A', 'b', 'C', 'd', 'E'],
)
)
hover = HoverTool(
tooltips=[
("index", "$index"),
("(x,y)", "($x, $y)"),
("desc", "@desc"),
]
)
p = figure(plot_width=700, plot_height=700, tools=[hover],
title="Mouse over the dots")
p.circle('x', 'y', size=10, source=source)
show(p)
@pwnedDesal
Copy link

how about if i have mutliple circle()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment