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

Fix clim handling for pcolor{,mesh}.#21146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:masterfromanntzer:clim
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7232,3 +7232,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

[8]ページ先頭

©2009-2025 Movatter.jp