Skip to content

Commit cf19f75

Browse files
committed
FIX: check for weird norms
1 parent 3b32e16 commit cf19f75

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.boundaries is not None and self.spacing == 'uniform'
588+
return (type(self.norm) in [colors.Normalize, colors.LogNorm] and
589+
not contouring)
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-
if self._use_auto_colorbar_locator():
1122+
if type(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)