How can I customize the modebar in plotly (preferably in R)?

Viewed 865

In particular, I am looking for a way to hide all buttons except the download image button. I tried to use the config argument but so far only managed to hide the entire modebar using displayModeBar = F. Any help would be highly appreciated.

1 Answers

Here's what you are looking for:

plot_ly(economics, x = ~pop) %>% 
  config(displaylogo = FALSE, collaborate = FALSE,
         modeBarButtonsToRemove = c(
           'sendDataToCloud', 'autoScale2d', 'resetScale2d', 'toggleSpikelines',
           'hoverClosestCartesian', 'hoverCompareCartesian',
           'zoom2d','pan2d','select2d','lasso2d','zoomIn2d','zoomOut2d'
         ))

enter image description here

Since possible buttons are going to depend on the type of graph, keep in mind this list.

Related