Moved importing matplotlib inside plotting method to make build work

2 jobs for master in 28 seconds (queued for 1 second)