add matplotlib as optional dependency