Skip to content

Commit

Permalink
Merge pull request #154 from ianhi/hyperslicer-vmin_vmax
Browse files Browse the repository at this point in the history
vmin_vmax for hyperslicer
  • Loading branch information
ianhi authored Dec 10, 2020
2 parents 1bf03b0 + 7d33ca0 commit 49a60f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mpl_interactions/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 15, 0)
version_info = (0, 16, 0)
__version__ = ".".join(map(str, version_info))
15 changes: 15 additions & 0 deletions mpl_interactions/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ def hyperslicer(
alpha=None,
vmin=None,
vmax=None,
vmin_vmax=None,
origin=None,
extent=None,
autoscale_cmap=True,
Expand Down Expand Up @@ -687,6 +688,10 @@ def hyperslicer(
for a in args:
if a is not None:
kwargs[a[0]] = a[1]
if vmin_vmax is not None:
if isinstance(vmin_vmax, tuple) and not isinstance(vmin_vmax[0], str):
vmin_vmax = ("r", *vmin_vmax)
kwargs["vmin_vmax"] = vmin_vmax

controls, params = gogogo_controls(
kwargs,
Expand All @@ -697,6 +702,16 @@ def hyperslicer(
extra_ctrls,
allow_dupes=True,
)
if vmin_vmax is not None:
params.pop("vmin_vmax")
params["vmin"] = controls.params["vmin"]
params["vmax"] = controls.params["vmax"]

def vmin(**kwargs):
return kwargs["vmin"]

def vmax(**kwargs):
return kwargs["vmax"]

def update(params, indices, cache):
if title is not None:
Expand Down

0 comments on commit 49a60f6

Please sign in to comment.