Interp1d.jl

Stable Dev Build Status

Interp1d is a Julia package for univariate interpolations.

This package is inspired by scipy.interpolate.interp1d function.

Requirements

Julia 1.6.x or higher.

How to install

using Pkg;Pkg.add("Interp1d")

and then just import it with using Interp1d.

If you want use latest development version,

using Pkg;Pkg.add(url = "https://github.com/AtsushiSakai/Interp1d.jl.git")

How to use

You can use many kind of univariate interpolations:

using Interp1d
using PyPlot
xi = collect(0.0:10.0) # x of interpolated points
yi = exp.(-xi./3.0) # y of interpolated points
x = collect(-1.0:0.1:11.0) # sampling points
for mode in INTERP_MODE_LIST # Do interpolations for all modes.
    f = interp(xi, yi, mode) # get an interpolation function
    y = f.(x) # Do interpolation
    plot(x, y, label=string(mode))
end
plot(xi, yi, "xr")
legend()

asll_mode_plot_sample

Details and other tips can be found in the latest documentaion:

Index