Interactive tooltips in matplotlib graphics

Is there a way to get interactive hints in the matplotlib plot? For example, I wanted to get this scatter plot with hovering tooltips ( http://mpld3.imtqy.com/examples/scatter_tooltip.html ) in my python application because they are really useful for visualization, Unfortunately, I don't want to show this in a browser but integrated into my own python application, is there any way to do this?

+5
source share
1 answer

Matplotlib can only create static images and animations. If you want something interactive, then the only way to achieve this is to use a module that outputs javascript. I would suggest reading bokeh .

It is well developed and is gaining a lot of strength in the python world as a good option for creating interactive stories. Here is an example of the bokeh hovertool feature.

Unfortunately, I do not want to show this in a browser, but integrated into my own python application

I’m not sure what your “native python application” is, but you won’t have fun conducting an interactive plot outside the browser. I highly recommend switching to the webapp route using bokeh if interactivity is really important to you.

+3
source

Source: https://habr.com/ru/post/1235897/


All Articles