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

孤街醉人 提交于 2021-01-27 12:10:21

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!