Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"interactive example" not working with PySide #5517

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

Closed
titusjan opened this issue Nov 19, 2015 · 4 comments
Closed

"interactive example" not working with PySide #5517

titusjan opened this issue Nov 19, 2015 · 4 comments
Milestone

Comments

@titusjan
Copy link

I am running the interactive example from the documentation using the Qt4Agg backend. That is, I run the following commands in a regular Python shell:

    import matplotlib.pyplot as plt
    plt.ion()
    plt.plot([1.6, 2.7])

When I put backend.qt4 : PyQt4 in my .matplotlibrc it works as expected. However, when I use backend.qt4 : PySide an empty, unresponsive window is shown.

After a bit of googling I am not so sure that the "interactive example" is supposed to work for alli interactive backends. Especially this comment by efiring indicates so. However this is in contradiction with the documentation.

Can you clarify this and/or update the documentation?

I am using OS-X 10.6.8, Python 2.7.10, Matplotlib 1.4.3, PySide 1.2.2 and PyQt 4.11.4.

@tacaswell
Copy link
Member

Try in IPython after having run %matplotlib qt.

The issue is the bridge between the python repl event loop and the qt event loop.

@titusjan
Copy link
Author

Yes, that works. I'm perfectly happy with using ipython --matplotlib=qt in the future but my issue is that the documentation is (likely) incorrect. Sorry if that wasn't clear.

In the interactive example section it says: "From an ordinary python prompt, or after invoking ipython with no options, try this: ...". It seems that this not always works. In the past I've often wondered what I did wrong and spend a lot of time with fruitless debugging.

@tacaswell
Copy link
Member

Can you put in a PR that changes that to something more accurate?

@tacaswell tacaswell added this to the next major release (2.0) milestone Nov 19, 2015
@tacaswell
Copy link
Member

The source for that section is at https://github.com/matplotlib/matplotlib/blob/master/doc/faq/usage_faq.rst You can edit it and create the pull request directly from the browser.

story645 added a commit to story645/matplotlib that referenced this issue Mar 21, 2016
Amended the documentation as suggested by @tacaswell in  matplotlib#5517
story645 added a commit to story645/matplotlib that referenced this issue Mar 21, 2016
Added link to what is a backend suggestion to explicitly explain that if interactivity isn't working, you need to activate an interactive backend.
tacaswell added a commit that referenced this issue Mar 21, 2016
@QuLogic QuLogic modified the milestones: 1.5.2 (Critical bug fix release), 2.0 (style change major release) Mar 22, 2016
bearstrong pushed a commit to bearstrong/matplotlib that referenced this issue Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants