Skip to content

Mention keyboard modifiers in toolbar tooltip texts. #17687

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

Merged
merged 2 commits into from
Jun 20, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 19, 2020

Otherwise the feature is a bit obscure... Closes #17658.
(The newline in the tooltip works at least with qt/wx/tk/gtk (but wx needs #17686 too), can't test macos locally.)

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Otherwise the feature is a bit obscure...
@jklymak
Copy link
Member

jklymak commented Jun 19, 2020

I love this feature, and didn't know it existed. But, ugh, you sure don't want to use those modifiers in a Jupiter notebook. x cuts the current cell, even clearly using the plot GUI. Not even sure where to report that or what to do about it, other than change my rcParam...

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltip doesn't change for macosx... I think it also has to change in _macosx.m (line 1161)

@anntzer
Copy link
Contributor Author

anntzer commented Jun 19, 2020

Let's see whether I can manage to make the osx backend also use the tooltips from the base class...

@jklymak
Copy link
Member

jklymak commented Jun 19, 2020

I don't think so:

  File "testSimple.py", line 5, in <module>
    fig, ax = plt.subplots()
  File "/Users/jklymak/matplotlib/lib/matplotlib/cbook/deprecation.py", line 450, in wrapper
    return func(*args, **kwargs)
  File "/Users/jklymak/matplotlib/lib/matplotlib/pyplot.py", line 1270, in subplots
    fig = figure(**fig_kw)
  File "/Users/jklymak/matplotlib/lib/matplotlib/pyplot.py", line 670, in figure
    figManager = new_figure_manager(num, figsize=figsize,
  File "/Users/jklymak/matplotlib/lib/matplotlib/pyplot.py", line 298, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "/Users/jklymak/matplotlib/lib/matplotlib/backend_bases.py", line 3483, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/Users/jklymak/matplotlib/lib/matplotlib/backend_bases.py", line 3489, in new_figure_manager_given_figure
    manager = cls.FigureManager(canvas, num)
  File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_macosx.py", line 98, in __init__
    self.toolbar = NavigationToolbar2Mac(canvas)
  File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_macosx.py", line 120, in __init__
    tuple(str(data_path / image_name) + ".pdf"
  File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_macosx.py", line 120, in <genexpr>
    tuple(str(data_path / image_name) + ".pdf"
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'

@anntzer
Copy link
Contributor Author

anntzer commented Jun 19, 2020

Well I can't actually test macosx code locally, I was just going to abuse CI (which does test instantiating a macosx window) to iterate until either it works or I give up...

@jklymak
Copy link
Member

jklymak commented Jun 19, 2020

ha ha. New version segfaults.

@anntzer
Copy link
Contributor Author

anntzer commented Jun 19, 2020

Did you recompile? CI seems happy. (I would be amazed to have been able to write the extension code right on the first try, though...)

@jklymak
Copy link
Member

jklymak commented Jun 19, 2020

Yes, I did recompile after cleaning out the build directory. Not sure what is wrong.

@jklymak
Copy link
Member

jklymak commented Jun 19, 2020

Travis seg faults as well...

@anntzer
Copy link
Contributor Author

anntzer commented Jun 20, 2020

Yup, missed a change... looks like travis is happy now (for real).

@jklymak
Copy link
Member

jklymak commented Jun 20, 2020

Works!

@jklymak jklymak merged commit 193b8f6 into matplotlib:master Jun 20, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 20, 2020
@anntzer anntzer deleted the tooltipkey branch June 20, 2020 16:04
jklymak added a commit that referenced this pull request Jun 20, 2020
…687-on-v3.3.x

Backport PR #17687 on branch v3.3.x (Mention keyboard modifiers in toolbar tooltip texts.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add advanced zoom and inspect feature to GUI for more productivity
3 participants