python - multi_line hover in bokeh -


as in question:

bokeh multi_line , hovertool

i found hovertool not implemented multi_line plots bit of setback. mentioned under 'warnings' here: http://bokeh.pydata.org/en/0.11.0/docs/reference/models/tools.html#bokeh.models.tools.hovertool

is there work arounds this? also, if implement feature, place start , there specific aware of? also, feature in current bokeh roadmap?

as of bokeh 0.12.4 (earlier, forget exact release) hover tool supports mutli_line:

from collections import defaultdict  import numpy np scipy.stats import norm  bokeh.plotting import show, figure bokeh.models import columndatasource, hovertool bokeh.palettes import viridis6  rt_x = np.linspace(118, 123, num=50)  mass_spec = defaultdict(list) scale, mz in [(1.0, 83), (0.9, 55), (0.6, 98), (0.4, 43), (0.2, 39), (0.12, 29)]:     mass_spec["rt"].append(rt_x)     mass_spec["rt_intensity"].append(norm(loc=120.4).pdf(rt_x) * scale)     mass_spec['mz_tip'].append(mz)     mass_spec['intensity_tip'].append(scale) mass_spec['color'] = viridis6  source = columndatasource(mass_spec)  p = figure(plot_height=400) p.multi_line(xs='rt', ys='rt_intensity', legend="intensity_tip",              line_width=5, line_color='color', line_alpha=0.6,              hover_line_color='color', hover_line_alpha=1.0,              source=source)  p.add_tools(hovertool(show_arrow=false, line_policy='next', tooltips=[     ('mz', '@mz_tip'),     ('rel intensity', '@intensity_tip') ]))  show(p) 

which results in

enter image description here


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -