# Nice interpolation

First, I want to thank John Hunter and Jouni Seppanen for

> their very useful help with my xticklabel problems. I
> have little experience with python, and am a total newbie
> wrt. matplotlib (- which is very impressive...).

Thanks!

> Few days ago I was looking for a method to interpolate
> 12hourly data, and was not happy with the python
> alternatives I found. I wanted something in native
> python, not wrappers to C or Fortran programs (in this

I think the best reason for writing it up in python is that it is fun
and instructive, but I don't agree with the "not wrappers of C or
Fortran". Note that pylab is built on top of Numeric, which is
written in C, the font handling is built on top of freetype, another C
library, and the antigrain renderer engine is a C++ library.
matplotlib ships with a fair amount of C/C++ code, and scipy does the
same for C, C++ and FORTRAN. The strength of python is its fluid
integration with other languages.

Also, the agg engine provides many 2d interpolation algorithms:

nearest, bilinear, bicubic, spline16, spline36, hanning, hamming,
hermite, kaiser, quadric, catrom, gaussian, bessel, mitchell,
sinc, lanczos, blackman

It would be nice to provide a more direct interface to these, and
other agg image functionality, in matplotlib.

Thanks for your code -- you may also want to look at scipy.interpolate

NAME
scipy.interpolate

FILE
/usr/lib/python2.4/site-packages/scipy/interpolate/__init__.py

DESCRIPTION
Interpolation Tools

···

===================

Wrappers around FITPACK functions:

splrep -- find smoothing spline given (x,y) points on curve.
splprep -- find smoothing spline given parametrically defined
curve.
splev -- evaluate the spline or its derivatives.
splint -- compute definite integral of a spline.
sproot -- find the roots of a cubic spline.
spalde -- compute all derivatives of a spline at given
points.
bisplrep -- find bivariate smoothing spline representation.
bisplev -- evaluate bivariate smoothing spline.

Interpolation Class

interp1d -- Create a class whose instances can linearly
interpolate
to compute unknown values.