title: Remove plotOutput() background in Shiny
body: <p>This seems like it should be simple, but I cannot figure it out, and I haven't been able to find anything that works through google.</p>
  <p>I just want to remove the entire of the background from a ggplot plot in Shiny, that is, the white part of the image below:</p>
  <p><a href="https://i.stack.imgur.com/COgsi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/COgsi.png" alt="enter image description here" /></a></p>
  <p>I have the following code, including...</p>
  <pre><code>theme(plot.background = element_blank())
  </code></pre>
  <p>...but it doesn't seem to work.</p>
  <pre><code>library(shiny)
  library(tidyverse)
  library(shinythemes)
  
  # Define UI logic
  ui &lt;- fluidPage(
    theme = shinytheme(&quot;darkly&quot;),
    plotOutput(&quot;testplot&quot;)
  )
  
  # Define server logic 
  server &lt;- function(input, output) {
  
      output$testplot &lt;- renderPlot({
          ggplot(
            mtcars,
            aes(
              x = disp,
              y = wt
            )
          ) + geom_point() +
          theme(
            plot.background = element_blank(),
            panel.background = element_blank()
          )
      })
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>