pygal.interpolate module

Interpolation functions

These functions takes two lists of points x and y and returns an iterator over the interpolation between all these points with precision interpolated points between each of them

pygal.interpolate.cubic_interpolate(x, y, precision=250, **kwargs)[source]

Interpolate x, y using a cubic algorithm https://en.wikipedia.org/wiki/Spline_interpolation

pygal.interpolate.hermite_interpolate(x, y, precision=250, type='cardinal', c=None, b=None, t=None)[source]

Interpolate x, y using the hermite method. See https://en.wikipedia.org/wiki/Cubic_Hermite_spline

This interpolation is configurable and contain 4 subtypes:
  • Catmull Rom
  • Finite Difference
  • Cardinal
  • Kochanek Bartels
The cardinal subtype is customizable with a parameter:
  • c: tension (0, 1)
This last type is also customizable using 3 parameters:
  • c: continuity (-1, 1)
  • b: bias (-1, 1)
  • t: tension (-1, 1)
pygal.interpolate.lagrange_interpolate(x, y, precision=250, **kwargs)[source]

Interpolate x, y using Lagrange polynomials https://en.wikipedia.org/wiki/Lagrange_polynomial

pygal.interpolate.quadratic_interpolate(x, y, precision=250, **kwargs)[source]

Interpolate x, y using a quadratic algorithm https://en.wikipedia.org/wiki/Spline_(mathematics)

pygal.interpolate.trigonometric_interpolate(x, y, precision=250, **kwargs)[source]

Interpolate x, y using trigonometric As per http://en.wikipedia.org/wiki/Trigonometric_interpolation