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

Commitcf19f75

Browse files
committed
FIX: check for weird norms
1 parent3b32e16 commitcf19f75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎lib/matplotlib/colorbar.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,9 @@ def _use_auto_colorbar_locator(self):
584584
Return if we should use an adjustable tick locator or a fixed
585585
one. (check is used twice so factored out here...)
586586
"""
587-
# contouring = self.boundaries is not None and self.spacing == 'uniform'
588-
return (type(self.norm)in [colors.Normalize,colors.LogNorm])
587+
contouring=self.boundariesisnotNoneandself.spacing=='uniform'
588+
return (type(self.norm)in [colors.Normalize,colors.LogNorm]and
589+
notcontouring)
589590

590591
def_reset_locator_formatter_scale(self):
591592
"""
@@ -1118,13 +1119,12 @@ def _mesh(self):
11181119
else:
11191120
y=self._proportional_y()
11201121
xmid=np.array([0.5])
1121-
ifself._use_auto_colorbar_locator():
1122+
iftype(self.norm)in [colors.Normalize,colors.LogNorm]:
11221123
y=norm.inverse(y)
11231124
x=norm.inverse(x)
11241125
xmid=norm.inverse(xmid)
11251126
else:
1126-
# occurs for norms that don't have an inverse, in
1127-
# which case manually scale:
1127+
# manually scale...
11281128
dv=self.vmax-self.vmin
11291129
x=x*dv+self.vmin
11301130
y=y*dv+self.vmin

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp