Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non interactive backend for matplotlib #4

Open
ijpulidos opened this issue Jun 23, 2020 · 3 comments
Open

Non interactive backend for matplotlib #4

ijpulidos opened this issue Jun 23, 2020 · 3 comments

Comments

@ijpulidos
Copy link

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.

@ijpulidos ijpulidos changed the title Now interactive backend in matplotlib Non interactive backend in matplotlib Jun 23, 2020
@ijpulidos ijpulidos changed the title Non interactive backend in matplotlib Non interactive backend for matplotlib Jun 23, 2020
@ijpulidos
Copy link
Author

ijpulidos commented Jun 23, 2020

Ok, apparently the issue in the gist in my previous comment is related to matplotlib version. I run into it with an old matplotlib 2.2.2 but not with 3.2.2. So that's one thing. I still think there could be some benefits on using the "Agg" backend, though, specially in terms of thread safety.

@csabadaday
Copy link
Collaborator

csabadaday commented Jun 24, 2020 via email

@cdboschen
Copy link

I want to also report the issue I found with trying to use the interactive plots in Jupyter Notebooks immediately after installing the most recent Anaconda (2020.07) on a Windows 10 platform. The issue specifically was that only the upper left hand quartile of a plot would display and can be reproduced in a notebook by doing:

import matplotlib.pyplot as plt

%matplotlib notebook
# running the above in its own code cell

plt.figure()
plt.plot([1,5],[2,10])    #or any other plot

I was able to reproduce this in a minimum environment of only installing the latest versions of python (3.8.5), jupyter (1.0.0) and matplotlib (3,3,0).

After rolling back to matplotlib version 3.1.3 in the minimum environment and then in the complete Anaconda 2020.07 installation the issue was resolved for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants