title: R Shiny: Removing ggplot2 background to make it transparent
body: <p>I want to have my ggplots on R Shiny Server have transparent. My ui.R for plotting is as follows:</p>
  
  <pre><code>  plotOutput("malPie", width="95%")
  </code></pre>
  
  <p>in the server.R my plotting function is as follows:</p>
  
  <pre><code> c &lt;- ggplot(dataFrame, aes(x=factor(nrow(dataFrame)),fill=graphX),environment=environment()) + geom_bar(width = 1)
      print(c + coord_polar(theta = "y")+ xlab(xLabel)+ylab(yLabel)+ labs(fill=legendTitle)+ theme(
      panel.grid.minor = element_blank(), 
      panel.grid.major = element_blank(),
      panel.background = element_blank(),
      plot.background = element_blank()
     ))
  </code></pre>
  
  <p>and where it's called:</p>
  
  <pre><code>  sub &lt;- data
    sub &lt;- subset(sub,sub$mal_tested=="1")
    drawGraph("pie",sub,factor(sub$mal_tested_pos),"Malaria Tests Done",NULL,"Malaria Tested Positive","Malaria")
  </code></pre>
  
  <p>But the graph rendered still has a white background and I want it to be transparent, not white. How do I achieve this? I have attached an image with an arrow showing the plot.
  <img src="https://i.stack.imgur.com/rX6Wl.png" alt="My shiny server application. Note the pie chart has a white background and I want it to be transparent"></p>
  
  <p>How do i change this background? Please help me.</p>