I'm trying to plot Chebyshev polynolmials using: numpy.polynomial.Chebyshev:
import math
from numpy import *
from numpy import polynomial as pol
from pylab import *
from scipy import *
from scipy import optimize
import warnings
warnings.simplefilter('ignore', np.RankWarning)
test = pol.Chebyshev(3)
print test
plot (test)
show()
···
=======================================================================
The print return: cheb([ 3.])
=======================================================================
and plot :
Traceback (most recent call last):
File "T:\Dropbox\Thèse\Python\fit sonde\test_poly_Tcheb.py", line
32, in <module>
plot (test)
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 2458, in plot
ret = ax.plot(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 3849, in plot
self.add_line(line)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1443,
in add_line
self._update_line_limits(line)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1451,
in _update_line_limits
p = line.get_path()
File "C:\Python27\lib\site-packages\matplotlib\lines.py", line 644,
in get_path
self.recache()
File "C:\Python27\lib\site-packages\matplotlib\lines.py", line 401, in recache
y = np.asarray(yconv, np.float_)
File "C:\Python27\lib\site-packages\numpy\core\numeric.py", line
235, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number