Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying image on point hover in Plotly

Tags:

r

plotly

r-plotly

Plotly allows you to display text fields when hovering over a point on a scatterplot. Is it possible to instead display an image associated with each point when the user hovers over or clicks on it? I am mostly just using the web interface, but I could instead push my ggplot from R.

like image 659
half-pass Avatar asked May 25 '15 19:05

half-pass


People also ask

How do you show figures in Plotly?

To display a figure using the renderers framework, you call the . show() method on a graph object figure, or pass the figure to the plotly. io. show function.

How do you add pictures to Plotly?

A background image can be added to the layout of a figure with fig. add_layout_image or by setting the images parameter of go. Layout .

What is hover name in Plotly?

Hover Labels is the most depectively-power feature for interactive visualization in plotly, for user it is the ability to reveal more information about the data points by moving the cursor (mouse) over the point and having a hover label appear.


1 Answers

Unfortunately, there is no easy way to display images on hover on plotly graphs at the moment.

If you are willing to learn some javascript, plotly's embed API allows you to customize hover (as well as click) interactivity.

Here is an example of a custom hover interaction showing images on top of a plotly graph. The javascript source code can be found here.

like image 142
etpinard Avatar answered Oct 14 '22 06:10

etpinard