I want to make an interactive scatter plot.
Specifically, when I click or place my mouse pointer on a point, the corresponding picture should be visualized.
Data structure is composed of x, y, and file-path (picture).
I tried following code but it didn't work.
library(plotly);library(png)
tmp=data.frame(x=c(1,2,3),y=c(1,2,3),
file_path=c('C:/Users/osj118/Pictures/brain_illustrator.png',
'C:/Users/osj118/Pictures/Cap 2021-05-17 12-32-24-509.png',
'C:/Users/osj118/Pictures/brain_illustrator.png')
)
tmp %>% plot_ly() %>% add_trace(x=~x,y=~y,z=readPNG(~file_path))
Error in path.expand(source) : invalid 'path' argument
The below figure is what I want to make.