Skip to content

Backend MacOSX keyboard not working #8982

Closed

Description

@agallenne

Hi,

I am on MacOS and using the MacOSX backend. When a plot is displayed and I want to save it, I cannot change the name or go right/left in the text entry, the keyboard is not working. It was working properly before with matplotlib 1.5.1, now I upgraded to 2.0.2 (with anaconda). For now I am using the PyQt5 backend, which is OK, but if I move my plot to my second monitor (higher resolution), the window size stays the same but not the plots which is over-zoomed :-/ Any ideas to make the MacOSX backend works or solved the "dpi" issue for PyQt5?

  • Operating System: Mac OSX 10.12.6
  • Matplotlib Version: 2.0.2
  • Python Version: 2.7.13
  • Jupyter Version (if applicable):
  • Other Libraries:

Activity

  1. WeatherGod commented on Aug 2, 2017

    @WeatherGod
    Member
  2. agallenne commented on Aug 2, 2017

    @agallenne
    Author

    Keyboard bindings are not working either. Other things like zooming seem to work correctly.

  3. dstansby commented on Aug 2, 2017

    @dstansby
    Member

    #8931 fixed the mixed resolution issue on Qt5. I'm not seeing the same issues as you on the OSX backend, so maybe it's a python 2 only issue.

  4. agallenne commented on Aug 2, 2017

    @agallenne
    Author

    Ok thank you very much. Do I have to make the changes from #8931 in the .py files myself or I can download them somewhere?

  5. agallenne commented on Aug 2, 2017

    @agallenne
    Author

    Well, if I copy and past the corresponding corrected file (backend_qt5.py), I have the following error when starting ipython: "ImportError: cannot import name _Backend".
    Am I doing something wrong!

  6. anntzer commented on Aug 2, 2017

    @anntzer
    Contributor

    That file also depends on other files that have changed since 2.0.2 has been released, so just copying that file will not work. I'll let the OSX devs comment on the best way to install off master.

  7. tacaswell commented on Aug 3, 2017

    @tacaswell
    Member

    How exactly

    The problem with mac may be related related to IPython's switch from readline -> prompt toolkit (but if zoom is working, that may not be the issue).

    Have you tried doing %matplotlib to make sure the event loop integration is set up correctly?

    There are also issue with osx + 'framework' builds see http://matplotlib.org/faq/osx_framework.html#osxframework-faq

  8. agallenne commented on Aug 3, 2017

    @agallenne
    Author

    Zoom is indeed working for the macosx backend (note that I used a terminal to run python with: ipython --pylab). It worked before with previous version of matplotlib and ipython. What about PyQt5 and the changes from #8931, how can I make them work on my computer?

  9. WeatherGod commented on Aug 3, 2017

    @WeatherGod
    Member
  10. agallenne commented on Aug 3, 2017

    @agallenne
    Author

    I did it yesterday and it did not change anything unfortunately.

  11. agallenne commented on Aug 4, 2017

    @agallenne
    Author

    Ok, so I removed all matplotlib versions I had in my .../site-packages/ directory, and installed the fresh one. The PyQt5 mixed resolution display (#8931) issue is fixed for me now. Thanks.

  12. added this to the milestone on Aug 5, 2017
  13. tacaswell commented on Aug 5, 2017

    @tacaswell
    Member

    @mdehoon Any guidance on what is wrong with the native backend?

  14. added this to the milestone on Aug 5, 2017
  15. 5 remaining items

  16. modified the milestones: , on Oct 9, 2017
  17. dopplershift commented on Oct 23, 2017

    @dopplershift
    Contributor

    I can't get IPython to run with the osx backend.

    If I run a plot from the command line using pythonw, I can't reproduce any problems with the keyboard. The default keybindings work and saving a figure is fine.

  18. modified the milestones: , v2.1.1 on Oct 23, 2017
  19. tacaswell commented on Oct 23, 2017

    @tacaswell
    Member

    The issue in IPython is likely missing integration with prompt toolkit (attn @Carreau )

  20. jklymak commented on Nov 6, 2017

    @jklymak
    Member

    @dopplershift I can't get ipython to rin the macos backend either. It gives me the "Framework required" error...

  21. tacaswell commented on Nov 7, 2017

    @tacaswell
    Member

    I observed this issue on a number of systems today, but did not get details of IPython / OSX versions, but mostly with mpl 2.1 (I think?).

  22. efiring commented on Nov 8, 2017

    @efiring
    Member

    @jklymak, in a conda environment, this works for me with matplotlib 2.1.0.post222+gad730d131 (which is just what I happen to have in that environment at the moment):

    (test) efiring@manini2:~/currents/temp/merger_qt2$ pythonw `which ipython`
    Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul  2 2016, 17:52:12)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: %matplotlib osx
    
    In [2]: import matplotlib.pyplot as plt
    
    In [3]: plt.plot([1,2,3,2,1])
    [<matplotlib.lines.Line2D at 0x115e157b8>]
    
  23. jklymak commented on Nov 8, 2017

    @jklymak
    Member

    Ah OK, didn't think to try a magic! Thanks!

  24. jklymak commented on Nov 8, 2017

    @jklymak
    Member

    Oh, and the which python trick. OK that works. But...

  25. efiring commented on Nov 8, 2017

    @efiring
    Member

    ...but the buttons don't work quite right. Very strange. Zoom and pan seem to work, but home, backwards, and forwards are erratic.

  26. dopplershift commented on Nov 13, 2017

    @dopplershift
    Contributor

    Both the forward/back/home buttons and the keyboard events are working fine for me with the current v2.1.x branch in IPython (using %matplotlib osx). I'm going to close this out, but feel free to re-open if you find this is a problem with 2.1.1 when that is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions