I'm creating a plotly
object in R
:
library(plotly)
p <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length, text = ~Species, hoverinfo="text",
marker = list(size = 10,
color = 'rgba(255, 182, 193, .9)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2))) %>%
layout(title = 'Styled Scatter',
yaxis = list(zeroline = FALSE),
xaxis = list(zeroline = FALSE))
As you can see it includes hoverino
.
Then at some point I would like to remove that hoverinfo
layer.
Any idea how to do that?
style(hoverinfo = 'none')
So putting it all together:
(p <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length, text = ~Species, hoverinfo="text",
marker = list(size = 10,
color = 'rgba(255, 182, 193, .9)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2))) %>%
layout(title = 'Styled Scatter',
yaxis = list(zeroline = FALSE),
xaxis = list(zeroline = FALSE)) %>%
style(hoverinfo = 'none'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With