When I turn on DEBUG in the python logger, matplotlib prints 10,000 lines of debug code that I do not want to see. I tried:
plt.set_loglevel("info")
as in their documentation, but still doesn't turn it off. I put the statement right after importing matplotlib, and tried it right after creating the plot with fig=plt.figure(...).
Neither works. Help? ubuntu20.04, python 3.8.5, matplotlib 3.3.3
I found this useful for disabling matplotlib loggers:
matplotlib.pyplot.set_loglevel (level = 'warning')
If you are saving your graphs as png files, you also have to disable the PIL (PngImagePlugin) logger. PIL uses the logging libary for this
To do this:
# get the the logger with the name 'PIL'
pil_logger = logging.getLogger('PIL')
# override the logger logging level to INFO
pil_logger.setLevel(logging.INFO)
you can also choose another logging level instead of INFO: documentation about logging levels
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With