Stateful transforms compatible with 'mgcv' R package

Hi!
I've added the file *mgcv.py* containing the code for the following stateful transforms: *cr/cs*, *cc* and *te*.
Benoît. 
Can you please include the script used to generate the figures, so that they can be updated if necessary later?

(Or, if it's short enough, it could be included inline in the documentation as an example -- `.. ipython::` blocks supposedly have matplotlib integration, so any figures generated will appear in the generated docs.)