关于在 r Shiny UI 中格式化绘图位置的快速问题。
到目前为止,我已经在 Server.R 中制作了一系列直方图,它们都在 UI 中完美显示。唯一的问题是,我希望它们排成两排,每排 4 排。我当前的代码,粘贴在下面,给了我 3 行!最上面的有 4 张图,第二张有 3 张图(有空间容纳第四张图),然后最后一行有 1 个图...我哪里出错了,有没有更好的方法来布置 8 个 Shiny 的图?
fluidRow(
column(12,
"",
fluidRow(
column(3,
plotOutput("PlotHy")#,
),
column(width = 3,
plotOutput("PlotMe")),
column(width = 3,
plotOutput("PlotEthane")),
column(width = 3,
plotOutput("PlotEthylene")),
column(width = 3,
plotOutput("PlotCO")),
column(width = 3,
plotOutput("PlotCO2")),
column(width = 3,
plotOutput("PlotO")),
column(width = 3,
plotOutput("PlotN"))
)
)
),
谢谢,詹姆斯
最佳答案
只需显式行分隔:
shinyUI(
fluidPage(
titlePanel("stack overflow question"),
fluidRow(
column(12,
"",
fluidRow(
column(3,
plotOutput("PlotHy")),
column(width = 3,
plotOutput("PlotMe")),
column(width = 3,
plotOutput("PlotEthane")),
column(width = 3,
plotOutput("PlotEthylene"))
), fluidRow(
column(width = 3,
plotOutput("PlotCO")),
column(width = 3,
plotOutput("PlotCO2")),
column(width = 3,
plotOutput("PlotO")),
column(width = 3,
plotOutput("PlotN"))
)
)
)
))
关于R Shiny 的情节布局用户界面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24948700/