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

Skip to content

Commit 5c28e95

Browse files
committed
do not fail on _DummyAxes
1 parent f04bff0 commit 5c28e95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,11 @@ def set_locs(self, locs):
846846
vmin, vmax = self.axis.get_view_interval()
847847
self.d = abs(vmax - vmin)
848848

849-
if hasattr(self.axis.get_transform(), 'linthresh'):
849+
if not hasattr(self.axis, 'get_transform'):
850+
# This might be a colorbar dummy axis, do not attempt to get
851+
# transform
852+
numdec = 10
853+
elif hasattr(self.axis.get_transform(), 'linthresh'):
850854
t = self.axis.get_transform()
851855
linthresh = t.linthresh
852856
# Only compute the number of decades in the logarithmic part of the

0 commit comments

Comments
 (0)