<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import numpy as np
import matplotlib.pyplot as plt
from numpy.polynomial import Chebyshev as T
np.random.seed(11)
x = np.linspace(0, 2*np.pi, 20)
y = np.sin(x) + np.random.normal(scale=.1, size=x.shape)
p = T.fit(x, y, 5)
plt.plot(x, y, 'o')
# [&lt;matplotlib.lines.Line2D object at 0x2136c10&gt;]
xx, yy = p.linspace()
plt.plot(xx, yy, lw=2)
# [&lt;matplotlib.lines.Line2D object at 0x1cf2890&gt;]
p.domain
# array([ 0.        ,  6.28318531])
p.window
# array([-1.,  1.])
plt.show()
</pre></body></html>