In the code fragment
below (complete and runs in a Notebook) my HoverTool
definition only works for @make .
The other two fields @mpg
and @hp
just show up as ??? .
See screenshot for example. I can’t seem to see what I’m doing
wrong. Can anyone provide a suggestion?
TIA, Ian
import pandas as pd
from bokeh.charts import Scatter
from bokeh.models import HoverTool
from bokeh.io import output_notebook, show
from bokeh.sampledata.autompg import autompg
output_notebook()
autompg['make'] = pd.Series((n.split()[0] for n in autompg.name), index=autompg.index)
s = Scatter(data=autompg[autompg.make.isin('ford volkswagen honda' .split())],
x='yr', y='mpg', color='make', tools='hover'
)
hover = s.select(dict(type=HoverTool))
hover.tooltips = [
('Make','@make' ),
('MPG', '@mpg' ),
('hp', '@hp' )
]
show(s)
On Oct 4, 2016, at 3:27 AM, Ian Stokes Rees <[email protected]> wrote:
In the code fragment below (complete and runs in a Notebook) my HoverTool definition only works for @make. The other two fields @mpg and @hp just show up as ???. See screenshot for example. I can’t seem to see what I’m doing wrong. Can anyone provide a suggestion?
TIA, Ian
<Screen Shot 2016-10-04 at 4.09.42 AM.png>
import pandas as
pd
from bokeh.charts import
Scatter
from bokeh.models import
HoverTool
from bokeh.io import
output_notebook, show
from bokeh.sampledata.autompg import
autompg
output_notebook()
autompg[
'make'] = pd.Series((n.split()[0] for n in
autompg.name), index=autompg.index)