我想使用R-shiny显示绘图,但没有模式栏。我试图使用配置选项,但它不起作用。代码如下:
library(shiny)
library(plotly)
ui <- fluidPage(
plotlyOutput("plot")
)
server <- function(input, output, session) {
output$plot <- renderPlotly({
p <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)
config(p, displayModeBar = FALSE)
p
})
}
shinyApp(ui, server)
此代码正确显示绘图,但忽略配置。模式栏仍然显示。我还尝试了不同的配置选项,比如displaylogo=FALSE,collaborate=FALSE分别隐藏logo和collaboration选项,它们也被忽略。
有人知道为什么不起作用吗?我的绘图版本是4.8.0
我真的很希望你能对此有所了解。