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

Skip to content

Commit 13ff336

Browse files
committed
multivar_colorbar: updates after rebase
1 parent 947f578 commit 13ff336

18 files changed

Lines changed: 19 additions & 14 deletions

lib/matplotlib/colorbar.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,21 +1559,24 @@ def _draw_all(self):
15591559
rasterized=rasterized,
15601560
edgecolors='none', shading='flat')
15611561
# Apply norm scaling (supports LogNorm etc.)
1562-
try:
1562+
if getattr(self.colorizer.norm.norms[0], '_scale', None):
1563+
# use the norm's scale (if it exists and is not None):
15631564
self.ax.set_yscale(self.colorizer.norm.norms[0]._scale)
1564-
except TypeError:
1565-
# fallback for custom norms
1565+
else:
1566+
# fallback for custom norms, or NoNorm()
15661567
self.ax.set_yscale(
15671568
'function',
15681569
functions=(
15691570
self.colorizer.norm.norms[0],
15701571
self.colorizer.norm.norms[0].inverse
15711572
)
15721573
)
1573-
try:
1574+
1575+
if getattr(self.colorizer.norm.norms[1], '_scale', None):
1576+
# use the norm's scale (if it exists and is not None):
15741577
self.ax.set_xscale(self.colorizer.norm.norms[1]._scale)
1575-
except TypeError:
1576-
# fallback for custom norms
1578+
else:
1579+
# fallback for custom norms, or NoNorm()
15771580
self.ax.set_xscale(
15781581
'function',
15791582
functions=(
-16.1 KB
Loading
20 KB
Loading
-14.4 KB
Loading
18.9 KB
Loading
694 Bytes
Loading
-241 Bytes
Loading
-7.75 KB
Loading
-17.5 KB
Loading
30.5 KB
Loading

0 commit comments

Comments
 (0)