Coupled Hover Events in Python?

Is it possible to do exactly this, but using Python?
https://plot.ly/javascript/hover-events/#coupled-hover-events

I have two sub plots (both scatter plots), each with the same text labels but different x and y data.
I would love to use coupled hover events, but I’m only familiar with Python.

2 Likes

I also would like to do just that! Is there a way we can raise awareness about this topic?

1 Like

Hi @gilesholbrow and @Fideous,

This isn’t possible from Python right now.

After the ipywidgets support lands (See https://github.com/plotly/plotly.py/pull/942) it will be possible to respond to hover with Python callbacks, and it will be possible to make updates to existing plots. So you will be able to do things like change the color of a corresponding point in another trace based on hover events.

What won’t be possible right away is triggering tooltips from Python, but I do think that would be pretty useful. Feel free to open an enhancement request at https://github.com/plotly/plotly.py/issues.

Thanks

2 Likes

Thanks for the response! (:

Hello,

I saw that the pull request you linked to has been merged to the master branch of plotly. Does this mean that doing such a thing is now possible? :slight_smile:

Thanks!

Hi @Khreas,

It is possible to respond to hover events when a figure is displayed as a FigureWidget. Here’s an example notebook that uses this approach https://plot.ly/python/cars-exploration/.

It’s not yet possible to trigger tooltips from Python, and as far as I can tell no one has opened an issue on this yet. Feel free to do so!

-Jon

1 Like

Thank you so much @jmmease!

I’ll try to give it a shot and will open an issue if it doesn’t fit my needs.

Cheers,
Khreas

1 Like