diff --git a/pages/download.rst b/pages/download.rst index 6e55527..eb9c38d 100644 --- a/pages/download.rst +++ b/pages/download.rst @@ -23,6 +23,9 @@ You can also download `the development snapshot from github `_ by ralph +- `Gentoo `_ by Ben de Groot If you are interested in creating packages for Linux distributions, `contact us `_. diff --git a/pages/home.rst b/pages/home.rst index 2d11d4c..1ba959d 100644 --- a/pages/home.rst +++ b/pages/home.rst @@ -101,8 +101,6 @@ Optional dependencies PNG output requires `CairoSVG `_, `tinycss `_ and `cssselect `_. Install those with ``pip install CairoSVG tinycss cssselect``. -Interpolations need the `scipy `_ python module. - Unit testing needs `py.test `_ or `nosetests `_. Visual testing is based on `flask `_. diff --git a/pages/interpolations.rst b/pages/interpolations.rst index df91df9..625d079 100644 --- a/pages/interpolations.rst +++ b/pages/interpolations.rst @@ -9,22 +9,6 @@ Interpolations .. contents:: -Interpolations need the `scipy python module `_. -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 `_ - Without interpolation: ---------------------- @@ -46,17 +30,74 @@ With cubic interpolation: chart = pygal.Line(interpolate='cubic') 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`` .. pygal-code:: - chart = pygal.Line(interpolate='krogh') + 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 `_ + + Interpolation precision ----------------------- @@ -67,12 +108,12 @@ You can change the resolution of the interpolation with the help of `interpolati .. pygal-code:: - chart = pygal.Line(interpolate='krogh', interpolation_precision=15) + chart = pygal.Line(interpolate='quadratic') chart.add('line', [1, 5, 17, 12, 5, 10]) .. pygal-code:: - chart = pygal.Line(interpolate='krogh', interpolation_precision=50) + chart = pygal.Line(interpolate='quadratic', interpolation_precision=3) chart.add('line', [1, 5, 17, 12, 5, 10])