Interpolations need the `scipy python module <http://www.scipy.org/>`_.
To enable it just specify the interpolation type to:
- linear
- nearest
- zero
- slinear
- quadratic
- cubic
- krogh
- barycentric
- univariate
- or an integer representing the order of the spline interpolator
For more info see `interp1d definition on scipy <http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d>`_
Without interpolation:
Without interpolation:
----------------------
----------------------
@ -46,17 +30,74 @@ With cubic interpolation:
chart = pygal.Line(interpolate='cubic')
chart = pygal.Line(interpolate='cubic')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.add('line', [1, 5, 17, 12, 5, 10])
With krogh interpolation:
-------------------------
With quadratic interpolation:
-----------------------------
``interpolate``
..pygal-code::
chart = pygal.Line(interpolate='quadratic')
chart.add('line', [1, 5, 17, 12, 5, 10])
With lagrange interpolation:
----------------------------
``interpolate``
..pygal-code::
chart = pygal.Line(interpolate='lagrange')
chart.add('line', [1, 5, 17, 12, 5, 10])
With trigonometric interpolation:
---------------------------------
``interpolate``
``interpolate``
..pygal-code::
..pygal-code::
chart = pygal.Line(interpolate='krogh')
chart = pygal.Line(interpolate='trigonometric')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.add('line', [1, 5, 17, 12, 5, 10])
With hermite interpolation:
---------------------------
``interpolate``
..pygal-code::
chart = pygal.Line(interpolate='hermite')
chart.add('line', [1, 5, 17, 12, 5, 10])
For hermite you can also pass additionnal parameters to configure tangent behaviour: