【问题标题】:Adjust the height of ggplot bar graph in a tabpabel in Shiny Dashboard在 Shiny Dashboard 的标签面板中调整 ggplot 条形图的高度
【发布时间】:2018-11-15 16:13:46
【问题描述】:

我在闪亮的仪表板中使用plotlyggplottabPanel 中呈现条形图。下面是我在 UI 部分的 tabPanel 上的代码。

tabBox(width =12, id = "plot4", height = "320px", selected = "FarmInputs",
   tabPanel("FarmInputs", plotlyOutput("inputsPlot", height = "auto"))
   )

我也在 tabPanel 中试过这个

tabPanel("FarmInputs", plotlyOutput("inputsPlot"),height = "320px")

在服务器函数中

renderPlotly({
ggplot(aes(var,value))+geom_bar(stat="Identity")+coord_flip()+theme_gdocs()
})

如屏幕截图所示,绘图呈现在所需的 tabPanel 高度之外。如何控制绘图的高度以使其在 tabPanel 中呈现精确?

【问题讨论】:

    标签: r ggplot2 shiny shinydashboard r-plotly


    【解决方案1】:

    尝试在renderPlot 函数中更改高度。这是代码: renderPlot(expr, width = "auto", height = "auto")

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-16
      • 2020-06-04
      相关资源
      最近更新 更多