HoverTool and bokeh.charts.Scatter

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)

This was a known issue, it is fixed in master by a recent PR:

  https://github.com/bokeh/bokeh/pull/5037

The fix is not in any full release yet.

Thanks,

Bryan

···

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)

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)

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f3af6ebb-3e94-e5b6-8056-a7404dc088df%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.