conan
conan copied to clipboard
Non interactive backend for matplotlib
Hello. From what I've seen the matplotlib backend when running CONAN is left as the default for the system. Lately I've run into some issues that I wasn't running into before. They are detailed here: https://gist.github.com/ijpulidos/dc4b96f0be7c114b00d4eb5723c4b0be
As far as I can see, changing some lines in how matplotlib is imported fixes this issue, basically I did the following in the header of the conan.py
file:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
As suggested in https://matplotlib.org/faq/howto_faq.html#working-with-threads and referenced in https://stackoverflow.com/questions/4706451/how-to-save-a-figure-remotely-with-pylab/4706614#4706614 . I think it would also improve the ability to run conan in parallel using threads or similar. I'm just not sure if this would end up having issues with other things or features from Conan, since I really haven't tested it extensively.