-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
after plotting using Qt4Agg backend in Mac OS, terminal gets slow, CPU increases #6038
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
Comments
This is with the plain python shell? If so, does it also occur with the ipython shell? |
I've just checked, and yes, it does happen with ipython. |
I wonder if it is related to readline being installed or not? The integration of the repl with an GUI event loop can be complex. |
I can reproduce the high CPU usage (15-30%) while holding down a key, after And now I am baffled, because when I try to reproduce the phenomenon in ipython, it is not happening. I wonder whether this is related to the rather long delay (many seconds, unless I get impatient and hit control-C) I sometimes encounter when exiting ipython after plotting. |
IPython does the event loop integration differently that pyqt4 does 'stock' (and that handling is installed via Can you reproduce this if you just make a qapp and create a window? |
Closing due to lack of response. Note that Qt4 was deprecated with Matplotlib 3.3. Feel free to reopen if there is still an issue with Qt5. |
Frequently, when I make plots in matplotlib using the Qt4Agg backend in the python shell in a default Mac OS terminal window, the CPU percentage gets high (as seen by Activity Monitor) and the terminal becomes laggy as I'm typing into it. The problem doesn't always occur (I can reproduce it maybe 50% of the time), but I've seen it after simply entering the following into the python shell
import matplotlib.pyplot as plt
plt.figure()
and then, say, holding down "a" on the keyboard and seeing if the CPU jumps up to 30% or so. Generally, the problem seems to start only after I've created the first figure with plt.figure() (after importing matplotlib.pyplot as plt). (The plot isn't displayed in this case, but I've also had the problem in interactive mode after the plot is displayed.) The lagginess continues after the figure's closed and seems to get worse over time, basically making it difficult to continue until I restart the python shell. The CPU gets high (say, 30-120% rather than the usual 0-2%), but only when I'm typing or when it's processing the last thing I typed.
I do not have the problem with the TkAgg backend, though for the macosx backend I do have the different issue shown here: #5964. backend.qt4 was set to PyQt4 in the matplotlibrc file.
matplotlib version: 1.5.1
python 3.5.1, Anaconda 2.5.0 (x86_64)
(I just reinstalled Anaconda with python 3.5, but I've also had the issue with a previous Anaconda version for python 2.7.)
Mac OS X 10.11.3
The text was updated successfully, but these errors were encountered: