# Cubic spline function

**URL:** <https://discourse.julialang.org/t/cubic-spline-function/12941>\
**Category:** Community\
**Tags:** question\
**Created:** [August 6, 2018, 2:57pm UTC](https://discourse.julialang.org/t/cubic-spline-function/12941 "2018-08-06T14:57:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chdlkl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chdlkl/32/4835_2.png) [@chdlkl](https://discourse.julialang.org/u/chdlkl)\
**Post date:** [August 6, 2018, 2:57pm UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/1 "2018-08-06T14:57:12Z")

</div>

Is there a cubic spline function in Julia?

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [August 6, 2018, 3:35pm UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/2 "2018-08-06T15:35:30Z")

</div>

Check out [https://github.com/JuliaMath/Interpolations.jl](https://github.com/JuliaMath/Interpolations.jl) or [https://github.com/kbarbary/Dierckx.jl](https://github.com/kbarbary/Dierckx.jl) or perhaps even `@pyimport scipy.interpolate as itp; itp.interpolate(...)` if you have Python/Scipy and PyCall.jl installed.

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [August 6, 2018, 4:31pm UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/3 "2018-08-06T16:31:50Z")

</div>

Do you need it on a regular or irregular grid and in how many dimensions?

---

<div class="post-metadata">

**Author:** ![chdlkl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chdlkl/32/4835_2.png) [@chdlkl](https://discourse.julialang.org/u/chdlkl)\
**Post date:** [August 7, 2018, 1:19am UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/4 "2018-08-07T01:19:56Z")

</div>

```julia
# regular and 1D 

```

---

<div class="post-metadata">

**Author:** ![chdlkl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chdlkl/32/4835_2.png) [@chdlkl](https://discourse.julialang.org/u/chdlkl)\
**Post date:** [August 7, 2018, 1:24am UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/5 "2018-08-07T01:24:16Z")

</div>

```julia
thank you very much!!!

```

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [August 7, 2018, 2:27am UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/6 "2018-08-07T02:27:55Z")

</div>

[https://github.com/JuliaMath/Interpolations.jl/blob/master/README.md#quickstart-guide](https://github.com/JuliaMath/Interpolations.jl/blob/master/README.md#quickstart-guide)

Cubic spline on regular grids, and linear ones on regular or irregular grids, are pretty easy to use

---

<div class="post-metadata">

**Author:** ![ethanminfang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethanminfang/32/10511_2.png) [@ethanminfang](https://discourse.julialang.org/u/ethanminfang)\
**Post date:** [November 16, 2019, 7:51pm UTC](https://discourse.julialang.org/t/cubic-spline-function/12941/7 "2019-11-16T19:51:54Z")

</div>

Hi marius311,

I tried irregular grid with cubic spline in Interpolation.jl, which doesn’t work. So seems Dierckx.jl works better for that?

Min
