Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5845,12 +5845,8 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,

kwargs.setdefault('snap', False)

collection = mcoll.PolyCollection(verts, **kwargs)

collection.set_alpha(alpha)
collection.set_array(C)
collection.set_cmap(cmap)
collection.set_norm(norm)
collection = mcoll.PolyCollection(
verts, array=C, cmap=cmap, norm=norm, alpha=alpha, **kwargs)
collection._scale_norm(norm, vmin, vmax)
self._pcolor_grid_deprecation_helper()

Expand Down Expand Up @@ -6079,14 +6075,10 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
# convert to one dimensional array
C = C.ravel()

collection = mcoll.QuadMesh(
coords, antialiased=antialiased, shading=shading, **kwargs)
snap = kwargs.get('snap', rcParams['pcolormesh.snap'])
collection.set_snap(snap)
collection.set_alpha(alpha)
collection.set_array(C)
collection.set_cmap(cmap)
collection.set_norm(norm)
collection = mcoll.QuadMesh(
coords, antialiased=antialiased, shading=shading, snap=snap,
array=C, cmap=cmap, norm=norm, alpha=alpha, **kwargs)
collection._scale_norm(norm, vmin, vmax)
self._pcolor_grid_deprecation_helper()

Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7225,3 +7225,11 @@ def test_empty_line_plots():
_, ax = plt.subplots()
line = ax.plot([], [])
assert len(line) == 1


def test_clim():
ax = plt.figure().add_subplot()
for plot_method in [ax.imshow, ax.pcolor, ax.pcolormesh, ax.pcolorfast]:
clim = (7, 8)
norm = plot_method([[0, 1], [2, 3]], clim=clim).norm
assert (norm.vmin, norm.vmax) == clim
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy