Added import exceptions for matplotlib.