This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Remove plotly highlight

I would like to remove the highlight effect on selected data when I accidentally select the incorrect point. Here is the example that I run. But, it did not show me the function that I want. Any thoughts on having this function? Thanks

library(ggplot2)
library(plotly)
library(magrittr)

# Prepare data
data <- mtcars

# Establish highlight key 
data <- highlight_key(data, ~cyl)

# Plot data
plot <- ggplot(data, aes(x = mpg, y = hp, color = cyl)) +
  geom_point()

# Convert to plotly plot using ggplotly, and highlight data
plot2 <- ggplotly(plot, tooltip = "cyl") %>%
  highlight(on = "plotly_hover", off = "plotly_deselect")
plotly r

0 answers

No answers yet.

Log in to answer this question.