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 e01f39c

Browse filesBrowse files
committed
Merge pull request #2639 from bulli92/master
BUGFIX: ensure that number of classes is always of type INT in Colormap
2 parents f226149 + 71464a8 commit e01f39c
Copy full SHA for e01f39c

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,13 @@ def __init__(self, name, N=256):
507507
508508
"""
509509
self.name = name
510-
self.N = N
510+
self.N = int(N) # ensure that N is always int
511511
self._rgba_bad = (0.0, 0.0, 0.0, 0.0) # If bad, don't paint anything.
512512
self._rgba_under = None
513513
self._rgba_over = None
514-
self._i_under = N
515-
self._i_over = N + 1
516-
self._i_bad = N + 2
514+
self._i_under = self.N
515+
self._i_over = self.N + 1
516+
self._i_bad = self.N + 2
517517
self._isinit = False
518518

519519
#: When this colormap exists on a scalar mappable and colorbar_extend

0 commit comments

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