Created
May 18, 2017 21:17
-
-
Save dela3499/e159b388258b5f1a7a3bac42fc0179fd to your computer and use it in GitHub Desktop.
Bokeh scatterplot with tooltips in the Jupyter notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
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
http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#setting-tool-visuals