moved matplotlib import into plotting section