How to make mpld3 work with seaborn (interactive tooltips)

前端 未结 3 704
不知归路
不知归路 2021-01-15 08:15

I can\'t seem to get the interactive tooltips powered by mpld3 to work with the fantastic lmplot-like scatter plots from seaborn.

I\'d love any pointer on how to get

3条回答
  •  萌比男神i
    2021-01-15 08:28

    I was able to get the tooltips to work by using the standard matplotlib scatter on top of the seaborn plot and very low alpha (you can't use zero)

    data_tip_points = ax.scatter(x_points, y_points, alpha=0.001)
    tooltip = plugins.PointLabelTooltip(data_tip_points, labels)
    

    It's a bit of a hack, but it works as seen here.

    http://nbviewer.ipython.org/urls/bitbucket.org/jeff_mcgehee/cds_presentation_intro/raw/49cc7808ec26adebec94ffa83973bb5db13017d7/CDS%20Intro%20Presentation.ipynb

提交回复
热议问题