the import of matplotlib should come after numpy and scipy. We go from the standard lib to more specific packages.