How to remove the options panel from ggplotly plot?

I have a graph that I show in shiny with plotly and ggplot2 . However, I do not want the options bar to appear on hover. Is there a way to use ggplotly(p) and remove the options bar?

+6
source share
1 answer

A wonderful response to the short version is reported:

 library(plotly) set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000), ] 

Using ggplotly :

 p <- ggplot(d, aes(carat, price)) + geom_point() ggplotly(p) %>% config(displayModeBar = F) 

If you are not using ggplotly , you can do:

 plot_ly(d, x = carat, y = price, text = paste("Clarity: ", clarity), mode = "markers", color = carat, size = carat) %>% config(displayModeBar = F) 
+6
source

Source: https://habr.com/ru/post/1011662/


All Articles