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

Skip to content

Commit c6729ba

Browse files
oscargustimhoffm
andauthored
Update lib/matplotlib/colorbar.py
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 5d4f70d commit c6729ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,8 @@ def _add_solids(self, X, Y, C):
653653
self.solids.set_rasterized(True)
654654
if self.drawedges:
655655
start_idx = 0 if self._extend_lower() else 1
656-
if self._extend_upper():
657-
self.dividers.set_segments(np.dstack([X, Y])[start_idx:])
658-
else:
659-
self.dividers.set_segments(np.dstack([X, Y])[start_idx:-1])
656+
end_idx = len(X) if self._extend_upper() else -1
657+
self.dividers.set_segments(np.dstack([X, Y])[start_idx:end_idx])
660658
else:
661659
self.dividers.set_segments([])
662660

0 commit comments

Comments
 (0)