Skip to content

Commit e63aa3d

Browse files
trygvradtacaswell
andcommitted
Apply suggestions from tacaswell
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
1 parent 86c46a4 commit e63aa3d

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6287,13 +6287,13 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
62876287
- (M, N) or M*N: a mesh with scalar data. The values are mapped to
62886288
colors using normalization and a colormap. See parameters *norm*,
62896289
*cmap*, *vmin*, *vmax*.
6290-
- (K, M, N): multiple images with scalar data. Must be used with
6290+
- (K, M, N): multiple layers with scalar data. Must be used with
62916291
a multivariate or bivariate colormap. See *cmap*.
62926292
- (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
62936293
- (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
62946294
i.e. including transparency.
62956295
6296-
Here M and N define the rows and columns of the image.
6296+
Here M and N define the rows and columns of the mesh.
62976297
62986298
X, Y : array-like, optional
62996299
The coordinates of the corners of quadrilaterals of a pcolormesh::

lib/matplotlib/colorizer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,7 @@ def _format_cursor_data_override(self, data):
518518

519519
# scalar data
520520
n = self.cmap.N
521-
g_sig_digits = self._sig_digits_from_norm(self.norm,
522-
data,
523-
n)
521+
g_sig_digits = self._sig_digits_from_norm(self.norm, data, n)
524522
return f"[{data:-#.{g_sig_digits}g}]"
525523

526524

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3266,7 +3266,7 @@ def __init__(self, norms, vmin=None, vmax=None, clip=False):
32663266
# Convert the list of norms to a tuple to make it immutable.
32673267
# If there is a use case for swapping a single norm, we can add support for
32683268
# that later
3269-
self._norms = tuple(n for n in norms)
3269+
self._norms = tuple(norms)
32703270

32713271
self.callbacks = cbook.CallbackRegistry(signals=["changed"])
32723272

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def _normalize_image_array(A, n_input=1):
671671
" must be explicitly declared, for example"
672672
f" cmap='{A.shape[0]}VarAddA'")
673673
raise TypeError(f"Invalid shape {A.shape} for image data")
674-
if A.ndim == 3:
674+
if A.ndim == 3 and n_input == 1:
675675
# If the input data has values outside the valid range (after
676676
# normalisation), we issue a warning and then clip X to the bounds
677677
# - otherwise casting wraps extreme values, hiding outliers and

0 commit comments

Comments
 (0)