import numpy as np
from bokeh.plotting import *
from bokeh.objects import HoverTool
from collections import OrderedDict

N = 80
x = np.linspace(0, 4*np.pi, N)
y = np.sin(x)

output_file("line.html", title="gridplot and hover")

p1 = scatter(x,y, color="red", tools=['pan','wheel_zoom','reset', 'hover'], name="line1")
hover1 = [t for t in curplot().tools if isinstance(t, HoverTool)][0]
hover1.tooltips = OrderedDict([("index", "$index"), ("(x,y)", "($x,$y)"), ("type", "@actype")])

p2 = scatter(x,y, color="blue", tools=['pan','wheel_zoom','reset', 'hover'], name="line2")
hover2 = [t for t in curplot().tools if isinstance(t, HoverTool)][0]
hover2.tooltips = OrderedDict([("index", "$index"), ("(x,y)", "($x,$y)")])

#gridplot([[p1,p2]])

show()
