Skip to content

Commit e1ee7dc

Browse files
committed
change call signature of colorizer._ensure_multivariate_data()
changed from colorizer._ensure_multivariate_data(n_input, A) to colorizer._ensure_multivariate_data(A, n_input)
1 parent cbb1979 commit e1ee7dc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6208,8 +6208,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
62086208
# If provided, _pcolorargs will check that X, Y and C have the same shape.
62096209
# Before this check, we need to convert C from shape (K, N, M), where K is
62106210
# the number of variates, to (N, M) with a data type with K fields.
6211-
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
6212-
args[-1])
6211+
data = mcolorizer._ensure_multivariate_data(args[-1],
6212+
colorizer_obj.norm.n_input)
62136213
args = (*args[:-1], data)
62146214

62156215
X, Y, C, shading = self._pcolorargs('pcolor', *args, shading=shading,
@@ -6465,8 +6465,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64656465
# If provided, _pcolorargs will check that X, Y and C have the same shape.
64666466
# Before this check, we need to convert C from shape (K, N, M), where K is
64676467
# the number of variates, to (N, M) with a data type with K fields.
6468-
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
6469-
args[-1])
6468+
data = mcolorizer._ensure_multivariate_data(args[-1],
6469+
colorizer_obj.norm.n_input)
64706470
args = (*args[:-1], data)
64716471

64726472
X, Y, C, shading = self._pcolorargs('pcolormesh', *args,

lib/matplotlib/colorizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def set_array(self, A):
582582
self._A = None
583583
return
584584

585-
A = _ensure_multivariate_data(self.norm.n_input, A)
585+
A = _ensure_multivariate_data(A, self.norm.n_input)
586586

587587
A = cbook.safe_masked_invalid(A, copy=True)
588588
if not np.can_cast(A.dtype, float, "same_kind"):
@@ -862,7 +862,7 @@ def _ensure_cmap(cmap, accept_multivariate=False):
862862
return cm.colormaps[cmap_name]
863863

864864

865-
def _ensure_multivariate_data(n_input, data):
865+
def _ensure_multivariate_data(data, n_input):
866866
"""
867867
Ensure that the data has dtype with n_input.
868868
Input data of shape (n_input, n, m) is converted to an array of shape

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def _normalize_image_array(A, n_input=1):
646646
Check validity of image-like input *A* and normalize it to a format suitable for
647647
Image subclasses.
648648
"""
649-
A = mcolorizer._ensure_multivariate_data(n_input, A)
649+
A = mcolorizer._ensure_multivariate_data(A, n_input)
650650
A = cbook.safe_masked_invalid(A, copy=True)
651651
if n_input == 1:
652652
if A.dtype != np.uint8 and not np.can_cast(A.dtype, float, "same_kind"):

0 commit comments

Comments
 (0)