Centering a plot within a fluidRow in Shiny

风流意气都作罢 提交于 2019-12-03 04:34:59

align="center" can be included within the column expression (not within plotOutput though). e.g.

fluidRow(
  column(8, align="center",
    plotOutput('plot1')
  )
)

You could use align="center" as part of your plotOutput() function. So your ui.R would like this:

ui.R

setwd("C:/Users/Nate/Documents/R Working Directory/appFolder/example")
shinyUI(fluidPage(
titlePanel("Test"),
sidebarLayout(
sidebarPanel(
p('stuff here')
  ),
mainPanel(
tabsetPanel(id = 'tabs1',
          tabPanel("main",
                   fluidRow(
                     column(8,
                            plotOutput('plot1',align="center")),
                     column(4,
                            p('2nd column'))),
                   fluidRow(
                   p("2nd row of viewing area"))
                   ),

          tabPanel("second",
               p("main viewing area")),
      tabPanel("third",
                      p('main viewing area')
                   )
))
)
))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!