File:Comparaison interpolation scipy interpolate polynomes.svg

Summary

Description
Français : Comparaisons de différentes interpolations polynomiales par partie proposées par Python Numpy.
English: Comparison beteween various picewise polynomial interpolations proposed by Python Numpy.
Date
Source Own work
Author Cdang
Category:Files by User:cdang
 
This W3C-invalid plot was created with Matplotlib.
Category:Invalid SVG created with Matplotlib#1000Comparaison%20interpolation%20scipy%20interpolate%20polynomes.svg
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt

xp = np.linspace(0, 2*np.pi, 5)
yp = np.sin(xp)

finterpa = interpolate.CubicSpline(xp, yp)

xa = np.linspace(-0.5*np.pi, 2.5*np.pi, 29)
ya = finterpa(xa)

xb = np.linspace(-0.5*np.pi, 2.5*np.pi, 25)
yb = finterpb(xb)

xf = np.linspace(-0.5*np.pi, 2.5*np.pi, 25)
yf = finterpf.__call__(xf)

xg = np.linspace(-0.9*np.pi, 2.9*np.pi, 49)
yg = finterpg.__call__(xg)

fig = plt.figure(figsize=[20, 12])

plt.plot(xa, ya, label="CubicSpline")
plt.plot(xb, yb, label="interp1d quadratic")
plt.plot(xf, yf, label="PchipInterpolator")
plt.plot(xg, yg, label="Akima1DInterpolator")
plt.legend()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Comparaison%20interpolation%20scipy%20interpolate%20polynomes.svg
Category:Self-published work Category:Interpolation Category:Python (programming language)
Category:CC-BY-SA-4.0 Category:Files by User:cdang Category:Interpolation Category:Invalid SVG created with Matplotlib Category:Pages using deprecated source tags Category:Python (programming language) Category:Self-published work