Search code examples
matplotlibtooltipmpld3

Tooltips disappear after zoom in/out when using matplotlib mpld3


I have a matplotlib figure with tooltips on the point markers: enter image description here

And the zoom in/out is working:

However after the zoom in/out is performed the tooltips no longer function: and even restoring the original (non-zoomed) size they do not come back.

enter image description here


Solution

  • If you use the pan-and-zoom tool (crossed arrows icon), tooltips should remain unchanged after zooming. If you use the box zoom (magnifier icon), while box zoom is active, the tooltips are turned off. The tooltips should appear again after clicking the box zoom magnify icon a second time to deactivate it. enter image description here Perhaps this UI could be clearer.

    Here is scatter plot with tooltips example you can use to see this in action.