问题
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:
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'
))
Since possible buttons are going to depend on the type of graph, keep in mind this list.
来源:https://stackoverflow.com/questions/54077366/how-can-i-customize-the-modebar-in-plotly-preferably-in-r