下面的示例将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)
归档时间: |
|
查看次数: |
13273 次 |
最近记录: |