Import matplotlib as required instead of always