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

Skip to content

Commit 145f35e

Browse files
authored
Merge pull request #11556 from jklymak/fix-colorbar-bad-ticks
Fix colorbar bad ticks
2 parents 39824ac + d5dae3c commit 145f35e

File tree

6 files changed

+757
-763
lines changed

6 files changed

+757
-763
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def __init__(self, colorbar):
240240
def tick_values(self, vmin, vmax):
241241
vmin = max(vmin, self._colorbar.norm.vmin)
242242
vmax = min(vmax, self._colorbar.norm.vmax)
243-
return ticker.MaxNLocator.tick_values(self, vmin, vmax)
243+
ticks = ticker.MaxNLocator.tick_values(self, vmin, vmax)
244+
return ticks[(ticks >= vmin) & (ticks <= vmax)]
244245

245246

246247
class _ColorbarLogLocator(ticker.LogLocator):
Binary file not shown.

0 commit comments

Comments
 (0)