Curious, why does the plot of f
get clipped around x=5.5?
julia> using Plots, Polynomials
julia> xdata = [1.0, 3.5, 5.5, 7.0]
julia> ydata = [1.6884409261691142, 1.1095511387771335, 0.9753592108946215, 0.9522272216874024]
julia> f = fit(xdata, ydata)
Polynomial(2.117795572338809 - 0.4985750122785805*x + 0.07285077836751414*x^2 - 0.0036304122586283856*x^3)
julia> plot(f, xlim=(1,7), ylim=(0,3), legend=false)
julia> f(4)
1.0567615925524965
julia> g(x) = 2.117795572338809 - 0.4985750122785805*x + 0.07285077836751414*x^2 - 0.0036304122586283856*x^3
g (generic function with 1 method)
(@v1.7) pkg> st
Status `~/.julia/environments/v1.7/Project.toml`
[c7e460c6] ArgParse v1.1.4
[6e4b80f9] BenchmarkTools v1.2.2
[fa961155] CEnum v0.4.1
[3da002f7] ColorTypes v0.11.0
[864edb3b] DataStructures v0.18.11
[53c48c17] FixedPointNumbers v0.8.4
[a09fc81d] ImageCore v0.9.3
[82e4d734] ImageIO v0.5.9
[682c06a0] JSON v0.21.2
[0f8b85d8] JSON3 v1.9.2
[2fda8390] LsqFit v0.12.1
[5fb14364] OhMyREPL v0.5.10
[91a5bcdd] Plots v1.25.3
[c3e4b0f8] Pluto v0.17.3
[f27b6e38] Polynomials v2.0.20
[c46f51b8] ProfileView v1.0.1
[a8a75453] StatProfilerHTML v1.0.0
[90137ffa] StaticArrays v1.2.13
[b8865327] UnicodePlots v2.5.1
[aacddb02] JpegTurbo_jll v2.1.0+0