From b856eb85e48d5530fdd6547e0b501e8139a13f6f Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 25 Jun 2013 19:14:48 +0200 Subject: [PATCH 1/6] Interpolation is only quadratic and cubic --- pages/interpolations.rst | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pages/interpolations.rst b/pages/interpolations.rst index df91df9..e15cc12 100644 --- a/pages/interpolations.rst +++ b/pages/interpolations.rst @@ -12,18 +12,8 @@ Interpolations 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: @@ -53,7 +43,7 @@ With krogh interpolation: .. pygal-code:: - chart = pygal.Line(interpolate='krogh') + chart = pygal.Line(interpolate='quadratic') chart.add('line', [1, 5, 17, 12, 5, 10]) @@ -67,12 +57,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=50) chart.add('line', [1, 5, 17, 12, 5, 10]) From 60a66aaf27061a5d567ae66f4231142c0d2b5f18 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 25 Jun 2013 19:15:51 +0200 Subject: [PATCH 2/6] Interpolation is not done by scipy anymore --- pages/home.rst | 2 -- pages/interpolations.rst | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) 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 e15cc12..3a19ada 100644 --- a/pages/interpolations.rst +++ b/pages/interpolations.rst @@ -9,8 +9,7 @@ Interpolations .. contents:: -Interpolations need the `scipy python module `_. -To enable it just specify the interpolation type to: +To enable interpolation, just specify the interpolation type to: - quadratic - cubic From c85fab6772a4e68c9674102569e73cfa7857c62e Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 25 Jun 2013 19:16:31 +0200 Subject: [PATCH 3/6] Fix title --- pages/interpolations.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/interpolations.rst b/pages/interpolations.rst index 3a19ada..06fc335 100644 --- a/pages/interpolations.rst +++ b/pages/interpolations.rst @@ -35,8 +35,8 @@ With cubic interpolation: chart = pygal.Line(interpolate='cubic') chart.add('line', [1, 5, 17, 12, 5, 10]) -With krogh interpolation: -------------------------- +With quadratic interpolation: +----------------------------- ``interpolate`` From 6104f951838abba9c9e193abbd35a857acf509c3 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 25 Jun 2013 19:17:31 +0200 Subject: [PATCH 4/6] Use an interesting value for interpolation precision --- pages/interpolations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/interpolations.rst b/pages/interpolations.rst index 06fc335..56d18cc 100644 --- a/pages/interpolations.rst +++ b/pages/interpolations.rst @@ -61,7 +61,7 @@ You can change the resolution of the interpolation with the help of `interpolati .. pygal-code:: - chart = pygal.Line(interpolate='quadratic', interpolation_precision=50) + chart = pygal.Line(interpolate='quadratic', interpolation_precision=3) chart.add('line', [1, 5, 17, 12, 5, 10]) From 874928501c19e1aa1f4728a8146f113a1e57464a Mon Sep 17 00:00:00 2001 From: Mounier Florian Date: Tue, 25 Jun 2013 19:43:36 +0200 Subject: [PATCH 5/6] Update the interpolation reference for a more exhaustive one --- pages/interpolations.rst | 62 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/pages/interpolations.rst b/pages/interpolations.rst index 56d18cc..625d079 100644 --- a/pages/interpolations.rst +++ b/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 `_ + + Interpolation precision ----------------------- From cbabce39134d666e76f4c80166706902288fe58a Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 5 Nov 2013 12:07:22 +0100 Subject: [PATCH 6/6] Add links to Fedora and Gentoo packages --- pages/download.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 `_.