Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny large plots overlap

Tags:

r

layout

shiny

I'm producing some pretty big plots (a grid of about 100 bar graphs). I use verticallayout with the default of fluid = TRUE. I have the size set in my server function
output$hist7 <- renderPlot({ #actual plot excluded though any will do }, height=1000, width=800)

When I try to place text below this plot with h1("text here"), "text here" ends up in the middle of hist7. This issue does not occur with any of the plots I didn't set the size for, this is the only one large enough that I have to set a size to prevent shiny scaling it down

like image 684
Torin T Avatar asked Oct 26 '25 19:10

Torin T


1 Answers

The fix should be

ui.R

plotOutput(outputId = 'plot2', width = "700px", height = "600px")

server.R

output$plot2 <- renderPlot({
    p <- ggplot(...) + geom_bar(stat="identity", ...)
    p
  }, width = 700, height = 600)
like image 185
pachadotdev Avatar answered Oct 29 '25 09:10

pachadotdev