This need more documentation in the docstring. In particular you should example all the figure. I don't understand figure 4 for instance, although I have put a total of 10 seconds of thinking into it :).