How can I display my plot without toolbars, in Shiny?

前端 未结 1 1355
一向
一向 2021-01-05 14:02

This question is an extension of this question.

I am plotting a rather large gglot in Shiny.

Using renderPlot(width = 1500, height = 1000, ...

相关标签:
1条回答
  • 2021-01-05 14:41

    You didn't post your theme.css, but the issue is probably that the css overflow argument is set to scroll for the div holding the plots in you app's css. This forces scrollbars if the div is too small for its content.

    The default height for a plotOutput is set to 400px, so in your renderPlot if you set the height to 1000 you will get a scrollbar if the overflow of the div is set to scroll.

    Try setting the height argument of plotOutput to 1000px or more for example:

    #add all the tabPanels to the list
    for (i in 2:(number_of_tabPages+1)){
      tabs[[i]]=tabPanel(paste0("Tab",i-1),plotOutput(paste0("plot",i-1),height="1100px"))
    
    }
    

    Should give something like this:

    enter image description here

    You can also try finding what sets the overflow to scroll for this div. I'm just suspecting this because when the code is run without the theme.css it looks fine without changing your code.

    0 讨论(0)
提交回复
热议问题