title: Plot/Convert an expression coming from sympy: Taylor series with matplotlib
body: <p>i´am trying to plot the function sin(x)/x and a taylor approximation of it.
  i use python 3 and pyzo - the first plot works but i have problems converting the series coming from the sympy module to an numpy expression that would work.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import sympy as sp
  from sympy.abc import x
  
  x = np.linspace(-10, 10, 100)
  y = np.sin(x)/x #first function
  plt.plot(x, y, 'k') #this is working fine
  
  ### this is a code that removes the "0(x**something)" part of 
  the series at the end 
  </code></pre>
  
  <p>i found it here <a href="http://pastebin.com/ZNQakWP7" rel="nofollow">http://pastebin.com/ZNQakWP7</a></p>
  
  <pre><code>def series(expr, x, x0, n, removeO=False):
  """
  sympy bugs avoided
  """
  # expr_series = expr.series(x, x0, n)
  # return expr_series.removeO() if removeO else expr_series
  expansion = list()
  for t in expr.lseries(x, x0):
      p = t.as_coeff_exponent(x)[1]
      if p &lt; n:
          expansion.append(t)
      else:
          break
  if not removeO:
      expansion.append(sp.O(x**n))
  return sp.Add(*expansion)
  ### my code continued ####
  
  y_t=series(sp.sin(x)/x,x,0,6,removeO=True)
  </code></pre>
  
  <p>if i look at y_t now i get this approximation </p>
  
  <pre><code>out: x**4/120 - x**2/6 + 1
  </code></pre>
  
  <p>Now i try to convert this to numpy in order to plot it as i did with the first function.</p>
  
  <pre><code>f_t = lambdify(x, y_t,modules=['numpy'])
  x = np.linspace(-10, 10, 100) #i do this because x has
  #been a symbolic variable before
  
  plt.plot(x, y_t, 'b') #this is where the problem occurs
  </code></pre>
  
  <p>i get the first plot also a second error message:</p>
  
  <pre><code> File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "F:\pyzo2013_0_2_2\lib\site-packages\matplotlib\pyplot.py", line 2832, in plot
      ret = ax.plot(*args, **kwargs)
    File "F:\pyzo2013_0_2_2\lib\site-packages\matplotlib\axes.py", line 3998, in plot
      for line in self._get_lines(*args, **kwargs):
  </code></pre>
  
  <p>How can i achieve my idea to plot something coming from sympy?
  Another idea i had was to convert the sympy out from the series to a string and then parsing this somehow to a numpy expression. I would be thankful for any help here!</p>