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

Skip to content

Commit 0644334

Browse files
committed
Privatize resample
1 parent 727898e commit 0644334

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matplotlib/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_cmap(name=None, lut=None):
159159
if lut is None:
160160
return cmap_d[name]
161161
else:
162-
return cmap_d[name].resample(lut)
162+
return cmap_d[name]._resample(lut)
163163
else:
164164
raise ValueError(
165165
"Colormap %s is not recognized. Possible values are: %s"

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def is_gray(self):
659659
return (np.alltrue(self._lut[:, 0] == self._lut[:, 1]) and
660660
np.alltrue(self._lut[:, 0] == self._lut[:, 2]))
661661

662-
def resample(self, lutsize):
662+
def _resample(self, lutsize):
663663
"""
664664
Return a new color map with *lutsize* entries.
665665
"""
@@ -778,7 +778,7 @@ def from_list(name, colors, N=256, gamma=1.0):
778778

779779
return LinearSegmentedColormap(name, cdict, N, gamma)
780780

781-
def resample(self, lutsize):
781+
def _resample(self, lutsize):
782782
"""
783783
Return a new color map with *lutsize* entries.
784784
"""
@@ -848,7 +848,7 @@ def _init(self):
848848
self._isinit = True
849849
self._set_extremes()
850850

851-
def resample(self, lutsize):
851+
def _resample(self, lutsize):
852852
"""
853853
Return a new color map with *lutsize* entries.
854854
"""

0 commit comments

Comments
 (0)