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

Skip to content

Add painter widget #7411

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
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add handling of state_modifier_keys
  • Loading branch information
blink1073 committed Nov 6, 2016
commit cdcd45ea40fd74b4c0e8e4e7c6964d275ec89a80
6 changes: 4 additions & 2 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ def test(x, y):

def __init__(self, ax, on_select=None, overlay_props=None,
cursor_props=None, radius=5, cmap=LABELS_CMAP,
useblit=True, button=None):
useblit=True, button=None, state_modifier_keys=None):
"""
Parameters:
Copy link
Member

Choose a reason for hiding this comment

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

Please use numpydoc style for new documentation. Basically all you need is to add some underlining:

Parameters
----------

and then remove the unnecessary emphasis on the parameter names.


Expand All @@ -2652,9 +2652,11 @@ def __init__(self, ax, on_select=None, overlay_props=None,
- Whether to use blitting.
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary bullet point. Also, indent is only 3 spaces instead of 4.

*button* : list
The button numbers supported for the tool (defaults to [1, 2, 3])
*state_modifier_keys* : dict
A mapping of key names to state modifiers.
"""
super(Painter, self).__init__(ax, on_select,
useblit=useblit, button=button)
useblit=useblit, button=button, state_modifier_keys=None)
Copy link
Member

Choose a reason for hiding this comment

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

This needs to match the opening ( to follow PEP8, or there can be no arguments on the first line.

self.cmap = cmap
self._previous = None
self._overlay = None
Expand Down