Skip to content

Commit 47e87fb

Browse files
authored
Merge pull request #145 from ianhi/sci
fix sci when not psased the current axis
2 parents 28f763f + 62b47e2 commit 47e87fb

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

mpl_interactions/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (0, 13, 0)
1+
version_info = (0, 13, 1)
22
__version__ = ".".join(map(str, version_info))

mpl_interactions/generic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from matplotlib import get_backend
77
from matplotlib.colors import TABLEAU_COLORS, XKCD_COLORS, to_rgba_array
88
from matplotlib.path import Path
9-
from matplotlib.pyplot import close, subplots, sci
9+
from matplotlib.pyplot import close, subplots
1010
from matplotlib.widgets import LassoSelector
1111
from numpy import asanyarray, asarray, max, min, swapaxes
1212

@@ -717,7 +717,9 @@ def update(params, indices, cache):
717717
url=url,
718718
)
719719
# this is necessary to make calls to plt.colorbar behave as expected
720-
sci(im)
720+
# i know it's bad news to use private methods :(
721+
# but idk how else to accomplish being a psuedo-pyplot
722+
ax._sci(im)
721723
if title is not None:
722724
ax.set_title(title.format(**params))
723725

mpl_interactions/pyplot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from matplotlib.collections import PatchCollection
88
from matplotlib.colors import to_rgba_array
99
from matplotlib.patches import Rectangle
10-
from matplotlib.pyplot import sca, sci
10+
from matplotlib.pyplot import sca
1111

1212
from .controller import Controls, gogogo_controls
1313

@@ -578,7 +578,7 @@ def check_callable_alpha(alpha_, params, cache):
578578
)
579579
# this is necessary to make calls to plt.colorbar behave as expected
580580
sca(ax)
581-
sci(scatter)
581+
ax._sci(scatter)
582582

583583
return controls
584584

@@ -706,8 +706,10 @@ def update(params, indices, cache):
706706
resample=resample,
707707
url=url,
708708
)
709-
# this is necessary to make calls to plt.colorbar behave as expected
710-
sci(im)
709+
710+
# i know it's bad news to use private methods :(
711+
# but idk how else to accomplish being a psuedo-pyplot
712+
ax._sci(im)
711713
return controls
712714

713715

0 commit comments

Comments
 (0)