title: Sympy issues with plotting a piecewise function
body: <p>I have defined a SymPy piecewise function to compute the Federal Income tax for 2017. I know the function is working as I have tried various inputs and compared it to verified tax calculators and it gives the same result.</p>
  
  <p>However, when trying to plot the SymPy function, I get the error:</p>
  
  <pre><code>TypeError: '&gt;=' not supported between instances of 'complex' and 'int'
  </code></pre>
  
  <p>I never defined any complex numbers.</p>
  
  <pre><code>def getFedTax(alpha,p,GI):
  # alpha is an array indicating the starting dollar amount of each tax bracket, not including 0
  #p is an array of the Tax Percentage amount corresponding to the interval BEFORE each alpha, i.e. [0,alpha0) corresponds to p0, [alpha0, alpha1) corresponds to p1, etc.
  #x is the Gross Income for computation
  
  # create an array of the cumulative sums for each starting point in alpha
  cumsums = [0,p[0]*(alpha[0]-0)]
  cumnum = cumsums[1]
  for i,num in enumerate(alpha[1:-1],start=1):
      cumsums.append(p[i]*(alpha[i]-alpha[i-1]) + cumnum)
      cumnum = cumnum + p[i]*(alpha[i]-alpha[i-1])
  
  cumsums.append(p[-2]*(alpha[-1]-alpha[-2]) + cumnum)
  
  #Create the argument list of tuples for the SymPy.Piecewise function
  argtuples = []
  for n,bracstart in enumerate(alpha):
      if n == 0:
          argtuples.append((cumsums[0] + p[0]*x, And(0&lt;=x, x&lt;alpha[0])))
      elif 0 &lt; n and n &lt; len(alpha)-1:
          argtuples.append((cumsums[n] + p[n]*(x - alpha[n-1]), And(alpha[n-1] &lt;= x, x &lt; alpha[n])))
      else:
          argtuples.append((cumsums[-1]+p[-1]*(x-alpha[-1]), x&gt;alpha[-1]))
  
  t = Piecewise(*argtuples)
  
  
  return round(t.subs(x,GI),2), t
  
  from sympy import Piecewise, And
  from sympy.plotting.plot import plot
  from sympy.abc import x
  
  ti = getFedTax([9325.00,37950.00,91900.00,191650.00,416700.00,418400.00],
  [0.10,0.15,0.25,0.28,.33,.35,.396],1000000)
  
  plot(ti[1],(x,1.,450000.00))  
  </code></pre>
  
  <p>Full traceback:  </p>
  
  <pre><code>    runfile('C:/Users/galileo/Downloads/trial.py', 
  wdir='C:/Users/galileo/Downloads')
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
      execfile(filename, namespace)
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
      exec(compile(f.read(), filename, 'exec'), namespace)
  
    File "C:/Users/galileo/Downloads/trial.py", line 39, in &lt;module&gt;
      plot(ti[1],(x,1.,450000.00))
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\plot.py", line 1295, in plot
      plots.show()
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\plot.py", line 196, in show
      self._backend.show()
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\plot.py", line 1029, in show
      self.process_series()
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\plot.py", line 908, in process_series
      collection = self.LineCollection(s.get_segments())
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\plot.py", line 514, in get_segments
      f_start = f(self.start)
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\experimental_lambdify.py", line 231, in __call__
      result = self.lambda_func(args)
  
    File "c:\users\galileo\appdata\local\programs\python\python36\lib\site-
  packages\sympy\plotting\experimental_lambdify.py", line 316, in __call__
      return self.lambda_func(*args, **kwargs)
  
    File "&lt;string&gt;", line 1, in &lt;lambda&gt;
  
  
  TypeError: '&gt;=' not supported between instances of 'complex' and 'int'
  </code></pre>