コード例 #1
0
d.curve_fit(SF.quadratic, result=True, header="Curve-fit")
d.setas = "x...y"
d.plot(fmt="b-", label="curve-fit")
d.annotate_fit(
    SF.quadratic,
    prefix="quadratic",
    x=0.2,
    y=0.65,
    fontdict={
        "size": "x-small",
        "color": "blue"
    },
)

d.setas = "xy"
fit = SF.Quadratic()
p0 = fit.guess(y, x=x)
d.lmfit(SF.Quadratic, p0=p0, result=True, header="lmfit")

d.setas = "x...y"
d.plot(fmt="g-", label="lmfit")
d.annotate_fit(
    SF.Quadratic,
    prefix="Quadratic",
    x=0.65,
    y=0.65,
    fontdict={
        "size": "x-small",
        "color": "green"
    },
)
コード例 #2
0
def Quadratic(x, p):
    """Simple Qudratic Function."""
    return _SF.Quadratic(x, *p)