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

Commitf93c204

Browse files
committed
Fix support for clim in scatter.
This is the same issue and same fix as for pcolor{,mesh} in 2d8f3be.
1 parent7eaf90b commitf93c204

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,13 +4429,12 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
44294429
alpha=alpha
44304430
)
44314431
collection.set_transform(mtransforms.IdentityTransform())
4432-
collection.update(kwargs)
4433-
44344432
ifcolorsisNone:
44354433
collection.set_array(c)
44364434
collection.set_cmap(cmap)
44374435
collection.set_norm(norm)
44384436
collection._scale_norm(norm,vmin,vmax)
4437+
collection.update(kwargs)
44394438

44404439
# Classic mode only:
44414440
# ensure there are margins to allow for the

‎lib/matplotlib/tests/test_axes.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fromcollectionsimportnamedtuple
22
importdatetime
33
fromdecimalimportDecimal
4+
fromfunctoolsimportpartial
45
importio
56
fromitertoolsimportproduct
67
importplatform
@@ -7271,7 +7272,13 @@ def test_empty_line_plots():
72717272

72727273
deftest_clim():
72737274
ax=plt.figure().add_subplot()
7274-
forplot_methodin [ax.imshow,ax.pcolor,ax.pcolormesh,ax.pcolorfast]:
7275+
forplot_methodin [
7276+
partial(ax.scatter,range(3),range(3),c=range(3)),
7277+
partial(ax.imshow, [[0,1], [2,3]]),
7278+
partial(ax.pcolor, [[0,1], [2,3]]),
7279+
partial(ax.pcolormesh, [[0,1], [2,3]]),
7280+
partial(ax.pcolorfast, [[0,1], [2,3]]),
7281+
]:
72757282
clim= (7,8)
7276-
norm=plot_method([[0,1], [2,3]],clim=clim).norm
7283+
norm=plot_method(clim=clim).norm
72777284
assert (norm.vmin,norm.vmax)==clim

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp