Fixups from review · matplotlib/matplotlib@cfdb753 · GitHub
Skip to content

Commit cfdb753

Browse files
committed
Fixups from review
1 parent 20b894b commit cfdb753

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion

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
if np.iterable(self._alpha):
869869
if self._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
raise ValueError(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
if alpha is not None:
616616
if np.iterable(alpha):
617617
alpha = np.asarray(alpha)
618-
if not (alpha.shape == xa.shape):
619-
raise ValueError("alpha is array-like but it's shape"
618+
if alpha.shape != xa.shape:
619+
raise ValueError("alpha is array-like but its 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

0 commit comments

Comments
 (0)