闪亮的图表空间分配

use*_*440 23 r shiny

下面的示例将4个窗格中的4个组拼接在一起.但问题是他们似乎居住在一个网格中.是否可以控制闪亮输出中的图表大小?(即,当应用程序运行时右侧没有滚动条)我试图控制高度和宽度,但这似乎只能控制网格本身内的图像...任何想法?

谢谢

shinyUI(pageWithSidebar(
  headerPanel("Example"),
  sidebarPanel(   

  ),

  mainPanel(
    tabsetPanel(tabPanel("Main",plotOutput("temp"))

    )#tabsetPanel  

  )#mainPane;

))



shinyServer(function(input, output) {

  output$temp <-renderPlot({
     par(mfrow=c(2,2))
     plot(1:10)
     plot(rnorm(10))
     plot(rnorm(10))
     plot(rnorm(10))
  }, height = 1000, width = 1000)


})
Run Code Online (Sandbox Code Playgroud)

Joe*_*eng 30

plotOutput也有高度和宽度参数; width默认为"100%"(表示容器中可用宽度的100%),高度默认为"400px"(400像素).尝试尝试这些值,将它们更改为"auto""1000px".

renderPlot的高度和宽度参数控制生成的图像文件的大小(以像素为单位),但不会直接影响网页中的渲染大小.它们的默认值都是"auto",这意味着,检测并使用相应的宽度/高度plotOutput.因此,一旦设置了宽度和高度plotOutput,通常就不需要设置宽度和高度renderPlot.

shinyUI(pageWithSidebar(
  headerPanel("Example"),
  sidebarPanel(   

  ),

  mainPanel(
    tabsetPanel(tabPanel("Main",plotOutput("temp", height = 1000, width = 1000))

    )#tabsetPanel  

  )#mainPane;

))



shinyServer(function(input, output) {

  output$temp <-renderPlot({
     par(mfrow=c(2,2))
     plot(1:10)
     plot(rnorm(10))
     plot(rnorm(10))
     plot(rnorm(10))
  })


})
Run Code Online (Sandbox Code Playgroud)