Show tooltip for only one layer in ggplot2 and plotly

You can suppress the tooltip on black dots using the style function:

ggplotly(gg, tooltip=c("y")) %>%
  layout(hovermode = "x unified") %>%
  style(hoverinfo = "skip", traces = 1)

For more examples, see chapter Controlling Tooltips of the book Interactive web-based data visualization with R, plotly, and shiny.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top