title: How can I change the default theme in ggplot2?
body: <h2>Background</h2>
  
  <p>I would like to change the theme that ggplot uses, but I am having difficulty understanding the <code>theme_update()</code> documentation and examples. </p>
  
  <p>I am using <code>align_plots()</code> to place a boxplot over a density plot, but I found none of that code was causing the error, and was left with the minimal example. I suspect that the error is caused by the use of <code>theme_blank()</code>, but I am not sure why it occurs or how I can fix it.</p>
  
  <p>So, here I provide a minimal reproducible example of an error that I am getting:</p>
  
  <pre><code>library(ggExtra)
  align.plots(qplot(1))
  </code></pre>
  
  <p>But it breaks after I update the theme:</p>
  
  <pre><code>newtheme &lt;- theme_update(axis.text.y = theme_blank(),
                           axis.line = theme_blank(),
                           axis.title.x = theme_blank(), 
                           axis.title.y = theme_blank(),
                           axis.ticks.x = theme_blank(),
                           panel.grid.major = theme_blank(),
                           panel.grid.minor = theme_blank(),
                           panel.border = theme_blank(),
                           axis.color.y = 'white')
  align.plots(qplot(1))
  </code></pre>
  
  <p>This gives the error:</p>
  
  <pre><code>Error in UseMethod("validGrob") : 
    no applicable method for 'validGrob' applied to an object of class "NULL"
  In addition: Warning message:
  In editThisGrob(grob, specs) : Slot 'vp' not found
  </code></pre>
  
  <h2>Questions:</h2>
  
  <ol>
  <li><p>What causes this error?</p></li>
  <li><p>Where can I get more information on using <code>?theme_update()</code>? I got this far on the ggplot documentation, and can't find the answer at the <a href="http://had.co.nz/ggplot2" rel="nofollow noreferrer">ggplot website</a>, although the closest that I got was the <a href="http://had.co.nz/ggplot2/book/polishing.r" rel="nofollow noreferrer">polishing.r</a> script</p></li>
  </ol>
  
  <h2>note:</h2>
  
  <p>I get the same error with a solution based on <a href="https://stackoverflow.com/questions/3824412/ggplot2-use-options-for-multiple-plots/3824489#3824489">Hadley's suggestion</a> for another question.</p>
  
  <pre><code>opt &lt;- opts(...)
  align.plots(qplot(1) + opt)
  </code></pre>
  
  <p>where <code>...</code> is the contents of <code>theme_update()</code> above</p>