Skip to content

Commit dc6dee7

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 15adfc1 commit dc6dee7

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
@@ -6195,8 +6195,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
61956195
# If provided, _pcolorargs will check that X, Y and C have the same shape.
61966196
# Before this check, we need to convert C from shape (K, N, M), where K is
61976197
# the number of variates, to (N, M) with a data type with K fields.
6198-
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
6199-
args[-1])
6198+
data = mcolorizer._ensure_multivariate_data(args[-1],
6199+
colorizer_obj.norm.n_input)
62006200
args = (*args[:-1], data)
62016201

62026202
X, Y, C, shading = self._pcolorargs('pcolor', *args, shading=shading,
@@ -6474,8 +6474,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64746474
# If provided, _pcolorargs will check that X, Y and C have the same shape.
64756475
# Before this check, we need to convert C from shape (K, N, M), where K is
64766476
# the number of variates, to (N, M) with a data type with K fields.
6477-
data = mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
6478-
args[-1])
6477+
data = mcolorizer._ensure_multivariate_data(args[-1],
6478+
colorizer_obj.norm.n_input)
64796479
args = (*args[:-1], data)
64806480

64816481
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
@@ -643,7 +643,7 @@ def _normalize_image_array(A, n_input=1):
643643
Check validity of image-like input *A* and normalize it to a format suitable for
644644
Image subclasses.
645645
"""
646-
A = mcolorizer._ensure_multivariate_data(n_input, A)
646+
A = mcolorizer._ensure_multivariate_data(A, n_input)
647647
A = cbook.safe_masked_invalid(A, copy=True)
648648
if n_input == 1:
649649
if A.dtype != np.uint8 and not np.can_cast(A.dtype, float, "same_kind"):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy