Made matplotlib import optional