Add travis.yml file.
Move matplotlib import inside function.