title: Why do i get KeyError: 'Patch' when using Spyder?
body: <p>When i run the code using Spyder, I get a <code>KeyError:'Patch'</code> error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 523, in runfile
      execfile(filename, namespace)
    File "C:\Users\zqh\Documents\Python Scripts\untitled1.py", line 8, in &lt;module&gt;
      from pylab import *
    File "C:\Anaconda\lib\site-packages\pylab.py", line 1, in &lt;module&gt;
      from matplotlib.pylab import *
    File "C:\Anaconda\lib\site-packages\matplotlib\pylab.py", line 265, in &lt;module&gt;
      from matplotlib.pyplot import *
    File "C:\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 26, in &lt;module&gt;
      from matplotlib.figure import Figure, figaspect
    File "C:\Anaconda\lib\site-packages\matplotlib\figure.py", line 36, in &lt;module&gt;
      from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
    File "C:\Anaconda\lib\site-packages\matplotlib\axes.py", line 29, in &lt;module&gt;
      import matplotlib.spines as mspines
    File "C:\Anaconda\lib\site-packages\matplotlib\spines.py", line 17, in &lt;module&gt;
      class Spine(mpatches.Patch):
    File "C:\Anaconda\lib\site-packages\matplotlib\spines.py", line 39, in Spine
      @docstring.dedent_interpd
    File "C:\Anaconda\lib\site-packages\matplotlib\docstring.py", line 108, in dedent_interpd
      return interpd(dedent(func))
    File "C:\Anaconda\lib\site-packages\matplotlib\docstring.py", line 39, in __call__
      func.__doc__ = func.__doc__ and func.__doc__ % self.params
  KeyError: 'Patch'
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>    # -*- coding: utf-8 -*-
  """
  Created on Wed Sep 18 16:37:52 2013
  
  @author: zqh
  """
  # Import everything from matplotlib (numpy is accessible via 'np' alias)
  from pylab import *
  
  # Create a new figure of size 8x6 points, using 100 dots per inch
  figure(figsize=(8,6), dpi=80)
  
  # Create a new subplot from a grid of 1x1
  subplot(111)
  
  X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
  C,S = np.cos(X), np.sin(X)
  
  # Plot cosine using blue color with a continuous line of width 1 (pixels)
  plot(X, C, color="blue", linewidth=1.0, linestyle="-")
  
  # Plot sine using green color with a continuous line of width 1 (pixels)
  plot(X, S, color="green", linewidth=1.0, linestyle="-")
  
  # Set x limits
  xlim(-4.0,4.0)
  
  # Set x ticks
  xticks(np.linspace(-4,4,9,endpoint=True))
  
  # Set y limits
  ylim(-1.0,1.0)
  
  # Set y ticks
  yticks(np.linspace(-1,1,5,endpoint=True))
  
  # Save figure using 72 dots per inch
  # savefig("../figures/exercice_2.png",dpi=72)
  
  # Show result on screen
  show()
  </code></pre>
  
  <p>When I try running the same code in an iPython notbook, the code works fine. I don't know why I'm getting this error when using Spyder and how to solve it. What can I try?</p>