In [1]:
import numpy as np
import scipy.odr as odr
import matplotlib.pyplot as plt
import func as fc

In [2]:
N = int(1e1)
sx = 3 * np.random.rand(N)
sy = np.random.rand(N)
x = 15 * np.random.randn(N)
y = 3 * x + 1.5 * np.random.randn(N)
def t_func(B, x):
    return B[0] + B[1]*x

In [3]:
fc.plot(x, y, sx=sx, sy=sy, fit=True, fit_func=t_func, fit_params=[1, 1])

In [ ]: