Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9f0839

Browse files
committed
BUG : fix #3805
Enusure that norm.v{min,max} are not `None` before expanding them to ensure that 0 < vmax-vmin.
1 parent 3a828dd commit e9f0839

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/matplotlib/colorbar.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,14 @@ def _process_values(self, b=None):
653653
self._values = v
654654
return
655655
else:
656-
self.norm.vmin, self.norm.vmax = mtrans.nonsingular(self.norm.vmin,
657-
self.norm.vmax,
658-
expander=0.1)
659656
if not self.norm.scaled():
660657
self.norm.vmin = 0
661658
self.norm.vmax = 1
659+
660+
self.norm.vmin, self.norm.vmax = mtrans.nonsingular(self.norm.vmin,
661+
self.norm.vmax,
662+
expander=0.1)
663+
662664
b = self.norm.inverse(self._uniform_y(self.cmap.N + 1))
663665
if self._extend_lower():
664666
b[0] = b[0] - 1

0 commit comments

Comments
 (0)