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

plotting with TkAgg backend becomes unresponsive after a certain qt5agg backend import command #8402

Closed
js54434 opened this issue Mar 29, 2017 · 5 comments

Comments

@js54434
Copy link

js54434 commented Mar 29, 2017

Bug report

I'm using a python library that happens to execute

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas

When I plot using the TkAgg backend in interactive mode, the figure is unresponsive, though the data shows itself in that figure if I open a new figure.

Code for reproduction

import matplotlib.pyplot as plt
plt.ion()
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
plt.figure()
plt.plot([1], 'ko')     # plot a point

Actual outcome

The figure is unresponsive and blank, and the Mac spinning beachball symbol shows if I hover the cursor over it.

Expected outcome

The figure is plotted and responsive.

Matplotlib version

Matplotlib version 2.0.0.

python info:
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin

Mac OS X, 10.11.6

Everything was installed using anaconda.

@tacaswell
Copy link
Member

Are you using plain python or IPython?

If the former I suspect that importing pyqt replaced the input hook from tk with the one from qt (for some more details see #4779 ). You may be able to track down how Tk sets up it's input hook and re-install it, but in general you should not expect multiple GUI frameworks to play nice in the same interactive session. The simplest solution is to just switch to using the Qt5 backend.

@js54434
Copy link
Author

js54434 commented Mar 30, 2017

I'm using plain python.

Switching backends isn't really an option. Qt4 is apparently used with matplotlib when installed by anaconda on a mac, and using Qt5 and Qt4 together seems to be discouraged, so Qt5 probably isn't an option. As for other backends, I'm having separate issues with Qt4 and MacOSX.

@QuLogic
Copy link
Member

QuLogic commented Mar 31, 2017

Qt4 is just used by default because that's the setting the conda packagers gave it by default. You can use Qt5 pretty easily by updating conda install qt=5 and then modifying your matplotlibrc to set the Qt5Agg backend instead.

@js54434
Copy link
Author

js54434 commented Mar 31, 2017

Just trying "conda install qt=5" gave me a package dependency error, so I ended up reinstalling anaconda, which happened to update it to python 3.6. I can now use Qt5, and I don't seem to have issues with it.

@tacaswell
Copy link
Member

Great, closing this as resolved.

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