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)
source share