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 support for clim in scatter.#21525

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
jklymak merged 1 commit intomatplotlib:mainfromanntzer:scatterclim
Nov 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
3 changes: 1 addition & 2 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4429,13 +4429,12 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
alpha=alpha
)
collection.set_transform(mtransforms.IdentityTransform())
collection.update(kwargs)

if colors is None:
collection.set_array(c)
collection.set_cmap(cmap)
collection.set_norm(norm)
collection._scale_norm(norm, vmin, vmax)
collection.update(kwargs)

# Classic mode only:
# ensure there are margins to allow for the
Expand Down
11 changes: 9 additions & 2 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
from collections import namedtuple
import datetime
from decimal import Decimal
from functools import partial
import io
from itertools import product
import platform
Expand DownExpand Up@@ -7271,7 +7272,13 @@ def test_empty_line_plots():

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

[8]ページ先頭

©2009-2025 Movatter.jp