我正在尝试从scatter3D绘图中删除绘图工具栏中的环绕旋转按钮。根据the manual (26.3 Remove modebar buttons by name)的说法,这听起来是可行的。然而,当我尝试它的时候,情节就消失了。常规scatter3d图:
fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec, color = ~am, colors = c('#BF382A', '#0C4B8E'))
fig <- fig %>% add_markers()
fig
但是,当我尝试使用名称列表here删除按钮时,绘图消失了(模式栏也消失了):
fig %>%
config(modeBarButtonsToRemove = c("orbitRotation"))
它似乎适用于某些按钮,但不适用于其他按钮--这是一个bug吗?
发布于 2021-04-07 01:12:32
如果只删除单个按钮,则此操作将失败。See this github issue。如果您将按钮名称放入列表中,它应该会起作用:
fig %>%
config(modeBarButtonsToRemove = list("orbitRotation"))https://stackoverflow.com/questions/66972610
复制相似问题