Fixed rotate method.
Added support for matplotlib.