Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7fc99b5

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 parentd7a64a4 commit7fc99b5

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

62836283
X,Y,C,shading=self._pcolorargs('pcolor',*args,shading=shading,
@@ -6555,8 +6555,8 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
65556555
# If provided, _pcolorargs will check that X, Y and C have the same shape.
65566556
# Before this check, we need to convert C from shape (K, N, M), where K is
65576557
# the number of variates, to (N, M) with a data type with K fields.
6558-
data=mcolorizer._ensure_multivariate_data(colorizer_obj.norm.n_input,
6559-
args[-1])
6558+
data=mcolorizer._ensure_multivariate_data(args[-1],
6559+
colorizer_obj.norm.n_input)
65606560
args= (*args[:-1],data)
65616561

65626562
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
@@ -569,7 +569,7 @@ def set_array(self, A):
569569
self._A=None
570570
return
571571

572-
A=_ensure_multivariate_data(self.norm.n_input,A)
572+
A=_ensure_multivariate_data(A,self.norm.n_input)
573573

574574
A=cbook.safe_masked_invalid(A,copy=True)
575575
ifnotnp.can_cast(A.dtype,float,"same_kind"):
@@ -849,7 +849,7 @@ def _ensure_cmap(cmap, accept_multivariate=False):
849849
returncm.colormaps[cmap_name]
850850

851851

852-
def_ensure_multivariate_data(n_input,data):
852+
def_ensure_multivariate_data(data,n_input):
853853
"""
854854
Ensure that the data has dtype with n_input.
855855
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
ifn_input==1:
649649
ifA.dtype!=np.uint8andnotnp.can_cast(A.dtype,float,"same_kind"):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp