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

Commitcfdb753

Browse files
committed
Fixups from review
1 parent20b894b commitcfdb753

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

‎lib/matplotlib/artist.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ def _set_alpha_for_array(self, alpha):
982982
Artist.set_alpha(self,alpha)
983983
return
984984
alpha=np.asarray(alpha)
985-
ifnot (alpha.min()>=0andalpha.max()<=1):
985+
ifnot (0<=alpha.min()andalpha.max()<=1):
986986
raiseValueError('alpha must be between 0 and 1, inclusive, '
987987
f'but min is{alpha.min()}, max is{alpha.max()}')
988988
self._alpha=alpha

‎lib/matplotlib/collections.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,9 @@ def set_alpha(self, alpha):
837837
838838
Parameters
839839
----------
840-
alpha: float or array of float
840+
alpha: float or array of float or None
841841
If not None, *alpha* values must be between 0 and 1, inclusive.
842-
If an array is provided,it's length must match the number of
842+
If an array is provided,its length must match the number of
843843
elements in the collection. Masked values and nans are not
844844
supported.
845845
"""
@@ -867,13 +867,13 @@ def update_scalarmappable(self):
867867
return
868868
ifnp.iterable(self._alpha):
869869
ifself._alpha.size!=self._A.size:
870-
# This can occur with the deprecated behavior of 'flat'
871-
# pcolormesh shading. If we bring the current change in
872-
# before that deprecated behavior is removed, we need to
873-
# add the explanation to the message below.
874870
raiseValueError(f'Data array shape,{self._A.shape} '
875871
'is incompatible with alpha array shape, '
876-
f'{self._alpha.shape}.')
872+
f'{self._alpha.shape}. '
873+
'This can occur with the deprecated '
874+
'behavior of the "flat" shading option, '
875+
'in which a row and/or column of the data '
876+
'array is dropped.')
877877
# pcolormesh, scatter, maybe others flatten their _A
878878
self._alpha=self._alpha.reshape(self._A.shape)
879879

‎lib/matplotlib/colors.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ def __call__(self, X, alpha=None, bytes=False):
615615
ifalphaisnotNone:
616616
ifnp.iterable(alpha):
617617
alpha=np.asarray(alpha)
618-
ifnot (alpha.shape==xa.shape):
619-
raiseValueError("alpha is array-like butit's shape"
618+
ifalpha.shape!=xa.shape:
619+
raiseValueError("alpha is array-like butits shape"
620620
" %s doesn't match that of X %s"%
621621
(alpha.shape,xa.shape))
622622

‎lib/matplotlib/image.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def set_alpha(self, alpha):
274274
275275
Parameters
276276
----------
277-
alpha : float or2-d array or None
277+
alpha : float or2D array-like or None
278278
"""
279279
martist.Artist._set_alpha_for_array(self,alpha)
280280
ifnp.ndim(alpha)notin (0,2):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp