Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 2, 2023
1 parent 6ccb49f commit ee2783b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
release = "unknown"



# -- Project information -----------------------------------------------------

project = "mpl_pan_zoom"
Expand Down
10 changes: 8 additions & 2 deletions mpl_pan_zoom/_pan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__all__ = [
"PanManager",
]


class PanManager:
"""
Enable panning a plot with any mouse button.
Expand Down Expand Up @@ -50,7 +52,9 @@ def enable(self):
raise RuntimeError("The PanManager is already enabled")

self._id_press = self.fig.canvas.mpl_connect("button_press_event", self.press)
self._id_release = self.fig.canvas.mpl_connect("button_release_event", self.release)
self._id_release = self.fig.canvas.mpl_connect(
"button_release_event", self.release
)

def disable(self):
"""
Expand Down Expand Up @@ -103,7 +107,9 @@ def press(self, event):
):
a.start_pan(x, y, event.button)
self._xypress.append((a, i))
self._id_drag = self.fig.canvas.mpl_connect("motion_notify_event", self._mouse_move)
self._id_drag = self.fig.canvas.mpl_connect(
"motion_notify_event", self._mouse_move
)

def release(self, event):
self._cancel_action()
Expand Down
2 changes: 2 additions & 0 deletions mpl_pan_zoom/_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
__all__ = [
"zoom_factory",
]


# based on https://gist.github.com/tacaswell/3144287
def zoom_factory(ax, base_scale=1.1):
"""
Expand Down
7 changes: 2 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ url = https://github.com/ianhi/mpl-pan-zoom
author = Ian Hunt-Isaak
author_email = ianhuntisaak@gmail.com
license = BSD-3-Clause
license_file = LICENSE
license_files = LICENSE
classifiers =
Development Status :: 2 - Pre-Alpha
License :: OSI Approved :: BSD License
Natural Language :: English
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
project_urls =
Source Code =https://github.com/ianhi/mpl-pan-zoom
Expand All @@ -26,7 +23,7 @@ packages = find:
install_requires =
matplotlib
numpy
python_requires = >=3.7
python_requires = >=3.8
zip_safe = False

[options.extras_require]
Expand Down

0 comments on commit ee2783b

Please sign in to comment.