title: Restoring Matplotlib default styles using `with`
body: <p>I would like to be able to temporarily used arbitrary staples for my Matplotlib plot using the idiom</p>
  <pre><code>with my_styles(style):
      # plotting code ...
  </code></pre>
  <p>and have defined</p>
  <pre><code>def my_styles(style='mine'):
      if style == 'mine':
          return plt.rc_context({
              &quot;font.family&quot;: &quot;sans-serif&quot;, 
              &quot;mathtext.fontset&quot;: &quot;dejavusans&quot;, 
              &quot;font.sans-serif&quot;: [&quot;Nunito&quot;, &quot;Open Sans&quot;] + plt.rcParams[&quot;font.sans-serif&quot;],
              &quot;text.usetex&quot;: False })
      elif style == 'another': 
          # USE - Very slow (?)
          return plt.rc_context({
              'axes.linewidth': 1.5,
              'lines.linewidth': 2.0,
              'figure.facecolor': 'white',
              'grid.linewidth': 0.0,
              'axes.grid': False,
              'axes.unicode_minus': False,
              'axes.edgecolor': 'black',
              'text.usetex': True
          })
      else:
          return plt.rc_context(plt.rc_params())
  </code></pre>
  <p>But the final case does not restore Matplotlib's default styles, and instead appears to continue to use styles previously used. How do I completely restore Matplotlib's defaults, and what is the correct idiom for doing so using <code>rc_context</code> and <code>with</code>?</p>