Second order polynomial fit in Makie.jl?

The easy way is to evaluate your fit and plot that:

    poly = Polynomials.fit(agmt_decyr, agmt_Vres, 2)
    evaluation_points = range(extrema(agmt_decyr)..., length=100)
    fit_values = poly.(evalutaion_points)
    CairoMakie.lines!(ax2, evaulation_points, fit_values; color = :white, linewidth = 3)

The hard way is to write a Makie type recipe for the Polynomial type:
https://docs.makie.org/stable/explanations/recipes/
and make a PR to the Polynomials package.

1 Like