如何在 plotly 中自定义模式栏(最好在 R 中)? [英] How can I customize the modebar in plotly (preferably in R)?

查看:56
本文介绍了如何在 plotly 中自定义模式栏(最好在 R 中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

特别是,我正在寻找一种方法来隐藏除下载图像按钮之外的所有按钮.我尝试使用 config 参数,但到目前为止只设法使用 displayModeBar = F 隐藏了整个模式栏.任何帮助将不胜感激.

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.

推荐答案

您正在寻找的内容:

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.

这篇关于如何在 plotly 中自定义模式栏(最好在 R 中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆