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

Skip to content

Commit d17905c

Browse files
authored
Merge pull request #18860 from jklymak/fix-colorbar-solid
FIX: stop deprecation message colorbar
2 parents 82e2f94 + 5bc66c2 commit d17905c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/colorbar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ def _add_solids(self, X, Y, C):
792792

793793
def _add_solids_pcolormesh(self, X, Y, C):
794794
_log.debug('Setting pcolormesh')
795+
if C.shape[0] == Y.shape[0]:
796+
# trim the last one to be compatible with old behavior.
797+
C = C[:-1]
795798
self.solids = self.ax.pcolormesh(
796799
X, Y, C, cmap=self.cmap, norm=self.norm, alpha=self.alpha,
797800
edgecolors='none', shading='flat')

0 commit comments

Comments
 (0)