Made matplotlib an optional dependency