Wrapped matplotlib import in try