Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 145f35e

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

File tree

Expand file treeCollapse file tree

6 files changed

+757
-763
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+757
-763
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+2-1Lines 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):
Loading
Binary file not shown.
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.