Search code examples
rplotlyplotly-dashr-plotlysurface

Way to turn off dynamic contour line appearing in plotly surface plot?


Spent a pretty much time trying to turn off this interactive grey lines that appear when you point at the surface plot in R. The graph code is down there, from which can be seen that I unsuccessfully tried with false showspikes and showline. Also, tried with contour(x,y,z= show = FALSE), but nothing. Any way to do it?

plot_ly(y = as.numeric(substr(povrsina$x, 3, 8)), 
               x = as.numeric(substr(povrsina$y, 3, 8)),
               z = povrsina$z, type = "surface", hoverinfo = "none") %>% layout(scene = list(xaxis = list(showspikes=FALSE,showline= FALSE), 
                                                                                             yaxis = list(showspikes=FALSE, showline= FALSE), 
                                                                                             zaxis = list(showspikes=FALSE,showline= FALSE)))

enter image description here


Solution

  • On the way to report a bug, I found this discussion https://github.com/plotly/plotly.js/issues/1406. Indeed, showspikes is not working as it should for surface plots. However, guide lines could be hidden with:

    contours = list(x = list(highlight=F),
                    y = list(highlight=F),
                    z = list(highlight=F))