bqplot

Container as tooltip doesn't show contents

南楼画角 提交于 2019-12-24 08:24:39
问题 I'm creating a scatterplot and want to show some information in a tooltip. The following works perfectly: import bqplot as bqp import ipywidgets as ipw xSc = bqp.LinearScale() ySc = bqp.LinearScale() tt = ipw.Label("A") def hover_handler(self, content): tt.value = str(content) s = bqp.Scatter(x=[0, 1, 2], y=[1, 2, 3], scales=dict(x=xSc, y=ySc), tooltip=tt) s.on_hover(hover_handler) bqp.Figure(marks=[s]) (there's no axes and whatnot to keep the code short) Hovering over each point shows its