Browse Source

Update the interpolation reference for a more exhaustive one

pull/71/head
Mounier Florian 12 years ago
parent
commit
874928501c
  1. 62
      pages/interpolations.rst

62
pages/interpolations.rst

@ -9,11 +9,6 @@ Interpolations
.. contents::
To enable interpolation, just specify the interpolation type to:
- quadratic
- cubic
Without interpolation:
----------------------
@ -35,6 +30,7 @@ With cubic interpolation:
chart = pygal.Line(interpolate='cubic')
chart.add('line', [1, 5, 17, 12, 5, 10])
With quadratic interpolation:
-----------------------------
@ -46,6 +42,62 @@ With quadratic interpolation:
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``
.. pygal-code::
chart = pygal.Line(interpolate='trigonometric')
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:
.. pygal-code::
chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'finite_difference'})
chart.add('line', [1, 5, 17, 12, 5, 10])
.. pygal-code::
chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'cardinal', 'c': .75})
chart.add('line', [1, 5, 17, 12, 5, 10])
.. pygal-code::
chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'kochanek_bartels', 'b': -1, 'c': 1, 't': 1})
chart.add('line', [1, 5, 17, 12, 5, 10])
For more information see the `wikipedia article <http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Finite_difference>`_
Interpolation precision
-----------------------

Loading…
Cancel
Save