Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63e789a

Browse files
trygvradtacaswell
andauthored
Apply suggestions from tacaswell
Co-authored-by: Thomas A Caswell <[email protected]>
1 parent 5fe91bb commit 63e789a

4 files changed

Lines changed: 5 additions & 7 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6377,13 +6377,13 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
63776377
- (M, N) or M*N: a mesh with scalar data. The values are mapped to
63786378
colors using normalization and a colormap. See parameters *norm*,
63796379
*cmap*, *vmin*, *vmax*.
6380-
- (K, M, N): multiple images with scalar data. Must be used with
6380+
- (K, M, N): multiple layers with scalar data. Must be used with
63816381
a multivariate or bivariate colormap. See *cmap*.
63826382
- (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
63836383
- (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
63846384
i.e. including transparency.
63856385
6386-
Here M and N define the rows and columns of the image.
6386+
Here M and N define the rows and columns of the mesh.
63876387
63886388
X, Y : array-like, optional
63896389
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
@@ -505,9 +505,7 @@ def _format_cursor_data_override(self, data):
505505

506506
# scalar data
507507
n = self.cmap.N
508-
g_sig_digits = self._sig_digits_from_norm(self.norm,
509-
data,
510-
n)
508+
g_sig_digits = self._sig_digits_from_norm(self.norm, data, n)
511509
return f"[{data:-#.{g_sig_digits}g}]"
512510

513511

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
@@ -658,7 +658,7 @@ def _normalize_image_array(A, n_input=1):
658658
" must be explicitly declared, for example"
659659
f" cmap='{A.shape[0]}VarAddA'")
660660
raise TypeError(f"Invalid shape {A.shape} for image data")
661-
if A.ndim == 3:
661+
if A.ndim == 3 and n_input == 1:
662662
# If the input data has values outside the valid range (after
663663
# normalisation), we issue a warning and then clip X to the bounds
664664
# - otherwise casting wraps extreme values, hiding outliers and

0 commit comments

Comments
 (0)