3

I'm using imread() from the matplotlib.pyplot library because I want to plot my scatter plots on top of an image:

import matplotlib.pyplot as plt
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
model_image = plt.imread('data/img1.jpg')

Everything works fine. However, when I use the logger of the standard python lib, it prints a DEBUG error:

DEBUG:PIL.Image:Error closing: 'NoneType' object has no attribute 'close'

This bothers me. Am I doing something wrong, our is it matplotlib fault?

FYI matplotlib version: 2.1.0

7
  • Should I use PIL directly or use pillow instead? Commented Dec 19, 2017 at 17:49
  • You may use anything you like. I'm currently not sure where this "Error" comes from (whether it is on the matplotlib side or the pil(low) side) but it is nothing to worry about too much. imread in itself works fine. Commented Dec 19, 2017 at 17:54
  • Is this something I should report as issue? Commented Dec 19, 2017 at 18:21
  • Because it does not prevent the use of the function, it's not that you "should" report it. You may however still do it, if you feel like it. As said, I'm not sure if this is on the matplotlib side or PIL side, so I wouldn't know where to report it actually ;-) Commented Dec 19, 2017 at 18:24
  • Yes, I will do that of course. Thanks! :) I will try to hide the error for now by suppressing the logs of the PIL module. Commented Dec 19, 2017 at 19:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.